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) ⇒ 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) ⇒ 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) ⇒ Object
Commit an existing prepared transaction with the given transaction identifier string.
12 13 14 |
# File 'lib/sequel/adapters/jdbc/h2.rb', line 12 def commit_prepared_transaction(transaction_id) run("COMMIT TRANSACTION #{transaction_id}") end |
#database_type ⇒ Object
H2 uses the :h2 database type.
17 18 19 |
# File 'lib/sequel/adapters/jdbc/h2.rb', line 17 def database_type :h2 end |
#rollback_prepared_transaction(transaction_id) ⇒ Object
Rollback an existing prepared transaction with the given transaction identifier string.
23 24 25 |
# File 'lib/sequel/adapters/jdbc/h2.rb', line 23 def rollback_prepared_transaction(transaction_id) run("ROLLBACK TRANSACTION #{transaction_id}") end |
#serial_primary_key_options ⇒ Object
H2 uses an IDENTITY type
28 29 30 |
# File 'lib/sequel/adapters/jdbc/h2.rb', line 28 def {:primary_key => true, :type => :identity, :identity=>true} end |
#supports_create_table_if_not_exists? ⇒ Boolean
H2 supports CREATE TABLE IF NOT EXISTS syntax.
33 34 35 |
# File 'lib/sequel/adapters/jdbc/h2.rb', line 33 def supports_create_table_if_not_exists? true end |
#supports_prepared_transactions? ⇒ Boolean
H2 supports prepared transactions
38 39 40 |
# File 'lib/sequel/adapters/jdbc/h2.rb', line 38 def supports_prepared_transactions? true end |
#supports_savepoints? ⇒ Boolean
H2 supports savepoints
43 44 45 |
# File 'lib/sequel/adapters/jdbc/h2.rb', line 43 def supports_savepoints? true end |