Module: Sequel::JDBC::HSQLDB::DatabaseMethods
- Extended by:
- Database::ResetIdentifierMangling
- Includes:
- Transactions
- Defined in:
- lib/sequel/adapters/jdbc/hsqldb.rb
Overview
Instance methods for HSQLDB Database objects accessed via JDBC.
Constant Summary collapse
- PRIMARY_KEY_INDEX_RE =
/\Asys_idx_sys_pk_/i.freeze
Constants included from Transactions
Transactions::TRANSACTION_BEGIN, Transactions::TRANSACTION_COMMIT, Transactions::TRANSACTION_RELEASE_SP, Transactions::TRANSACTION_ROLLBACK, Transactions::TRANSACTION_ROLLBACK_SP, Transactions::TRANSACTION_SAVEPOINT
Instance Method Summary collapse
-
#database_type ⇒ Object
HSQLDB uses the :hsqldb database type.
-
#db_version ⇒ Object
The version of the database, as an integer (e.g 2.2.5 -> 20205).
-
#serial_primary_key_options ⇒ Object
HSQLDB uses an IDENTITY sequence as the default value for primary key columns.
-
#supports_drop_table_if_exists? ⇒ Boolean
HSQLDB supports DROP TABLE IF EXISTS.
Methods included from Database::ResetIdentifierMangling
Methods included from Transactions
#supports_savepoints?, #supports_transaction_isolation_levels?
Instance Method Details
#database_type ⇒ Object
HSQLDB uses the :hsqldb database type.
24 25 26 |
# File 'lib/sequel/adapters/jdbc/hsqldb.rb', line 24 def database_type :hsqldb end |
#db_version ⇒ Object
The version of the database, as an integer (e.g 2.2.5 -> 20205)
35 36 37 38 39 40 41 42 |
# File 'lib/sequel/adapters/jdbc/hsqldb.rb', line 35 def db_version @db_version ||= begin v = get{DATABASE_VERSION(){}} if v =~ /(\d+)\.(\d+)\.(\d+)/ $1.to_i * 10000 + $2.to_i * 100 + $3.to_i end end end |
#serial_primary_key_options ⇒ Object
HSQLDB uses an IDENTITY sequence as the default value for primary key columns.
30 31 32 |
# File 'lib/sequel/adapters/jdbc/hsqldb.rb', line 30 def {:primary_key => true, :type => :integer, :identity=>true, :start_with=>1} end |
#supports_drop_table_if_exists? ⇒ Boolean
HSQLDB supports DROP TABLE IF EXISTS
45 46 47 |
# File 'lib/sequel/adapters/jdbc/hsqldb.rb', line 45 def supports_drop_table_if_exists? true end |