module Sequel::JDBC::HSQLDB::DatabaseMethods

  1. lib/sequel/adapters/jdbc/hsqldb.rb
Parent: HSQLDB

Instance methods for HSQLDB Database objects accessed via JDBC.

Included modules

  1. ::Sequel::JDBC::Transactions

Constants

DATABASE_ERROR_REGEXPS = { /integrity constraint violation: unique constraint or index violation/ => UniqueConstraintViolation, /integrity constraint violation: foreign key/ => ForeignKeyConstraintViolation, /integrity constraint violation: check constraint/ => CheckConstraintViolation, /integrity constraint violation: NOT NULL check constraint/ => NotNullConstraintViolation, /serialization failure/ => SerializationFailure, }.freeze  
PRIMARY_KEY_INDEX_RE = /\Asys_idx_sys_pk_/i.freeze  

Public Instance methods

database_type ()

HSQLDB uses the :hsqldb database type.

[show source]
# File lib/sequel/adapters/jdbc/hsqldb.rb, line 15
def database_type
  :hsqldb
end
db_version ()

The version of the database, as an integer (e.g 2.2.5 -> 20205)

[show source]
# File lib/sequel/adapters/jdbc/hsqldb.rb, line 26
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 ()

HSQLDB uses an IDENTITY sequence as the default value for primary key columns.

[show source]
# File lib/sequel/adapters/jdbc/hsqldb.rb, line 21
def serial_primary_key_options
  {:primary_key => true, :type => :integer, :identity=>true, :start_with=>1}
end