Module: Sequel::JDBC::H2::DatabaseMethods
- Includes:
- AutoCastDateAndTime
- Defined in:
- lib/sequel/adapters/jdbc/h2.rb
Instance Method Summary collapse
- #commit_prepared_transaction(transaction_id, opts = OPTS) ⇒ Object
- #database_type ⇒ Object
- #freeze ⇒ Object
- #h2_version ⇒ Object
- #rollback_prepared_transaction(transaction_id, opts = OPTS) ⇒ Object
-
#serial_primary_key_options ⇒ Object
H2 uses an IDENTITY type for primary keys.
-
#supports_create_table_if_not_exists? ⇒ Boolean
H2 supports CREATE TABLE IF NOT EXISTS syntax.
-
#supports_prepared_transactions? ⇒ Boolean
H2 supports prepared transactions.
-
#supports_savepoints? ⇒ Boolean
H2 supports savepoints.
Methods included from AutoCastDateAndTime
#requires_sql_standard_datetimes?
Instance Method Details
#commit_prepared_transaction(transaction_id, opts = OPTS) ⇒ Object
20 21 22 |
# File 'lib/sequel/adapters/jdbc/h2.rb', line 20 def commit_prepared_transaction(transaction_id, opts=OPTS) run("COMMIT TRANSACTION #{transaction_id}", opts) end |
#database_type ⇒ Object
24 25 26 |
# File 'lib/sequel/adapters/jdbc/h2.rb', line 24 def database_type :h2 end |
#freeze ⇒ Object
28 29 30 31 32 |
# File 'lib/sequel/adapters/jdbc/h2.rb', line 28 def freeze h2_version version2? super end |
#h2_version ⇒ Object
34 35 36 |
# File 'lib/sequel/adapters/jdbc/h2.rb', line 34 def h2_version @h2_version ||= get(Sequel.function(:H2VERSION)) end |
#rollback_prepared_transaction(transaction_id, opts = OPTS) ⇒ Object
38 39 40 |
# File 'lib/sequel/adapters/jdbc/h2.rb', line 38 def rollback_prepared_transaction(transaction_id, opts=OPTS) run("ROLLBACK TRANSACTION #{transaction_id}", opts) end |
#serial_primary_key_options ⇒ Object
H2 uses an IDENTITY type for primary keys
43 44 45 |
# File 'lib/sequel/adapters/jdbc/h2.rb', line 43 def {:primary_key => true, :type => :identity, :identity=>true} end |
#supports_create_table_if_not_exists? ⇒ Boolean
H2 supports CREATE TABLE IF NOT EXISTS syntax
48 49 50 |
# File 'lib/sequel/adapters/jdbc/h2.rb', line 48 def supports_create_table_if_not_exists? true end |
#supports_prepared_transactions? ⇒ Boolean
H2 supports prepared transactions
53 54 55 |
# File 'lib/sequel/adapters/jdbc/h2.rb', line 53 def supports_prepared_transactions? true end |
#supports_savepoints? ⇒ Boolean
H2 supports savepoints
58 59 60 |
# File 'lib/sequel/adapters/jdbc/h2.rb', line 58 def supports_savepoints? true end |