Module: Sequel::JDBC::H2::DatabaseMethods
- Extended by:
- Database::ResetIdentifierMangling
- Defined in:
- lib/sequel/adapters/jdbc/h2.rb
Overview
Instance methods for H2 Database objects accessed via JDBC.
Constant Summary collapse
- PRIMARY_KEY_INDEX_RE =
/\Aprimary_key/i.freeze
Instance Method Summary collapse
-
#commit_prepared_transaction(transaction_id, opts = OPTS) ⇒ Object
Commit an existing prepared transaction with the given transaction identifier string.
-
#database_type ⇒ Object
H2 uses the :h2 database type.
-
#rollback_prepared_transaction(transaction_id, opts = OPTS) ⇒ Object
Rollback an existing prepared transaction with the given transaction identifier string.
-
#serial_primary_key_options ⇒ Object
H2 uses an IDENTITY type.
-
#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 Database::ResetIdentifierMangling
Instance Method Details
#commit_prepared_transaction(transaction_id, opts = OPTS) ⇒ Object
Commit an existing prepared transaction with the given transaction identifier string.
22 23 24 |
# File 'lib/sequel/adapters/jdbc/h2.rb', line 22 def commit_prepared_transaction(transaction_id, opts=OPTS) run("COMMIT TRANSACTION #{transaction_id}", opts) end |
#database_type ⇒ Object
H2 uses the :h2 database type.
27 28 29 |
# File 'lib/sequel/adapters/jdbc/h2.rb', line 27 def database_type :h2 end |
#rollback_prepared_transaction(transaction_id, opts = OPTS) ⇒ Object
Rollback an existing prepared transaction with the given transaction identifier string.
33 34 35 |
# File 'lib/sequel/adapters/jdbc/h2.rb', line 33 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
38 39 40 |
# File 'lib/sequel/adapters/jdbc/h2.rb', line 38 def {:primary_key => true, :type => :identity, :identity=>true} end |
#supports_create_table_if_not_exists? ⇒ Boolean
H2 supports CREATE TABLE IF NOT EXISTS syntax.
43 44 45 |
# File 'lib/sequel/adapters/jdbc/h2.rb', line 43 def supports_create_table_if_not_exists? true end |
#supports_prepared_transactions? ⇒ Boolean
H2 supports prepared transactions
48 49 50 |
# File 'lib/sequel/adapters/jdbc/h2.rb', line 48 def supports_prepared_transactions? true end |
#supports_savepoints? ⇒ Boolean
H2 supports savepoints
53 54 55 |
# File 'lib/sequel/adapters/jdbc/h2.rb', line 53 def supports_savepoints? true end |