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

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

Instance Method Summary collapse

Methods included from Transactions

#supports_savepoints?, #supports_transaction_isolation_levels?

Methods included from AutoCastDateAndTime

#requires_sql_standard_datetimes?

Instance Method Details

#database_typeObject



22
23
24
# File 'lib/sequel/adapters/jdbc/hsqldb.rb', line 22

def database_type
  :hsqldb
end

#db_versionObject

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



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

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



26
27
28
29
# File 'lib/sequel/adapters/jdbc/hsqldb.rb', line 26

def freeze
  db_version
  super
end

#serial_primary_key_optionsObject

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



33
34
35
# File 'lib/sequel/adapters/jdbc/hsqldb.rb', line 33

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

Returns:

  • (Boolean)


47
48
49
# File 'lib/sequel/adapters/jdbc/hsqldb.rb', line 47

def supports_drop_table_if_exists?
  true
end