Module: Sequel::JDBC::H2::DatabaseMethods
- 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.
Instance Method Details
#commit_prepared_transaction(transaction_id, opts = OPTS) ⇒ Object
17 18 19 |
# File 'lib/sequel/adapters/jdbc/h2.rb', line 17 def commit_prepared_transaction(transaction_id, opts=OPTS) run("COMMIT TRANSACTION #{transaction_id}", opts) end |
#database_type ⇒ Object
21 22 23 |
# File 'lib/sequel/adapters/jdbc/h2.rb', line 21 def database_type :h2 end |
#freeze ⇒ Object
25 26 27 28 29 |
# File 'lib/sequel/adapters/jdbc/h2.rb', line 25 def freeze h2_version version2? super end |
#h2_version ⇒ Object
31 32 33 |
# File 'lib/sequel/adapters/jdbc/h2.rb', line 31 def h2_version @h2_version ||= get(Sequel.function(:H2VERSION)) end |
#rollback_prepared_transaction(transaction_id, opts = OPTS) ⇒ Object
35 36 37 |
# File 'lib/sequel/adapters/jdbc/h2.rb', line 35 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
40 41 42 |
# File 'lib/sequel/adapters/jdbc/h2.rb', line 40 def {:primary_key => true, :type => :identity, :identity=>true} end |
#supports_create_table_if_not_exists? ⇒ Boolean
H2 supports CREATE TABLE IF NOT EXISTS syntax
45 46 47 |
# File 'lib/sequel/adapters/jdbc/h2.rb', line 45 def supports_create_table_if_not_exists? true end |
#supports_prepared_transactions? ⇒ Boolean
H2 supports prepared transactions
50 51 52 |
# File 'lib/sequel/adapters/jdbc/h2.rb', line 50 def supports_prepared_transactions? true end |
#supports_savepoints? ⇒ Boolean
H2 supports savepoints
55 56 57 |
# File 'lib/sequel/adapters/jdbc/h2.rb', line 55 def supports_savepoints? true end |