Module: Sequel::JDBC::HSQLDB::DatabaseMethods

Includes:
Transactions
Defined in:
lib/sequel/adapters/jdbc/hsqldb.rb

Instance Method Summary collapse

Methods included from Transactions

#supports_savepoints?, #supports_transaction_isolation_levels?

Instance Method Details

#database_typeObject


20
21
22
# File 'lib/sequel/adapters/jdbc/hsqldb.rb', line 20

def database_type
  :hsqldb
end

#db_versionObject

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


36
37
38
39
40
41
42
# File 'lib/sequel/adapters/jdbc/hsqldb.rb', line 36

def db_version
  return @db_version if defined?(@db_version)
  v = get(Sequel.function(:DATABASE_VERSION))
  @db_version = if v =~ /(\d+)\.(\d+)\.(\d+)/
    $1.to_i * 10000 + $2.to_i * 100 + $3.to_i
  end
end

#freezeObject


24
25
26
27
# File 'lib/sequel/adapters/jdbc/hsqldb.rb', line 24

def freeze
  db_version
  super
end

#serial_primary_key_optionsObject

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


31
32
33
# File 'lib/sequel/adapters/jdbc/hsqldb.rb', line 31

def serial_primary_key_options
  {: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