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.
24 25 26 |
# File 'lib/sequel/adapters/jdbc/h2.rb', line 24 def commit_prepared_transaction(transaction_id, opts=OPTS) run("COMMIT TRANSACTION #{transaction_id}", opts) end |
#database_type ⇒ Object
H2 uses the :h2 database type.
29 30 31 |
# File 'lib/sequel/adapters/jdbc/h2.rb', line 29 def database_type :h2 end |
#rollback_prepared_transaction(transaction_id, opts = OPTS) ⇒ Object
Rollback an existing prepared transaction with the given transaction identifier string.
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
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 |