Module: Sequel::JDBC::H2::DatabaseMethods

Defined in:
lib/sequel/adapters/jdbc/h2.rb

Instance Method Summary collapse

Instance Method Details

#commit_prepared_transaction(transaction_id, opts = OPTS) ⇒ Object


17
18
19
# File 'lib/sequel/adapters/jdbc/h2.rb', line 17

def commit_prepared_transaction(transaction_id, opts=OPTS)
  run("COMMIT TRANSACTION #{transaction_id}", opts)
end

#database_typeObject


21
22
23
# File 'lib/sequel/adapters/jdbc/h2.rb', line 21

def database_type
  :h2
end

#freezeObject


25
26
27
28
# File 'lib/sequel/adapters/jdbc/h2.rb', line 25

def freeze
  h2_version
  super
end

#h2_versionObject


30
31
32
# File 'lib/sequel/adapters/jdbc/h2.rb', line 30

def h2_version
  @h2_version ||= get(Sequel.function(:H2VERSION))
end

#rollback_prepared_transaction(transaction_id, opts = OPTS) ⇒ Object


34
35
36
# File 'lib/sequel/adapters/jdbc/h2.rb', line 34

def rollback_prepared_transaction(transaction_id, opts=OPTS)
  run("ROLLBACK TRANSACTION #{transaction_id}", opts)
end

#serial_primary_key_optionsObject

H2 uses an IDENTITY type for primary keys


39
40
41
# File 'lib/sequel/adapters/jdbc/h2.rb', line 39

def serial_primary_key_options
  {:primary_key => true, :type => :identity, :identity=>true}
end

#supports_create_table_if_not_exists?Boolean

H2 supports CREATE TABLE IF NOT EXISTS syntax


44
45
46
# File 'lib/sequel/adapters/jdbc/h2.rb', line 44

def supports_create_table_if_not_exists?
  true
end

#supports_prepared_transactions?Boolean

H2 supports prepared transactions


49
50
51
# File 'lib/sequel/adapters/jdbc/h2.rb', line 49

def supports_prepared_transactions?
  true
end

#supports_savepoints?Boolean

H2 supports savepoints


54
55
56
# File 'lib/sequel/adapters/jdbc/h2.rb', line 54

def supports_savepoints?
  true
end