module Sequel::JDBC::H2::DatabaseMethods

  1. lib/sequel/adapters/jdbc/h2.rb

Included modules

  1. AutoCastDateAndTime

Constants

DATABASE_ERROR_REGEXPS = { /Unique index or primary key violation/ => UniqueConstraintViolation, /Referential integrity constraint violation/ => ForeignKeyConstraintViolation, /Check constraint violation/ => CheckConstraintViolation, /NULL not allowed for column/ => NotNullConstraintViolation, /Deadlock detected\. The current transaction was rolled back\./ => SerializationFailure, }.freeze  

Public Instance methods

commit_prepared_transaction(transaction_id, opts=OPTS)
[show source]
   # File lib/sequel/adapters/jdbc/h2.rb
20 def commit_prepared_transaction(transaction_id, opts=OPTS)
21   run("COMMIT TRANSACTION #{transaction_id}", opts)
22 end
database_type()
[show source]
   # File lib/sequel/adapters/jdbc/h2.rb
24 def database_type
25   :h2
26 end
freeze()
[show source]
   # File lib/sequel/adapters/jdbc/h2.rb
28 def freeze
29   h2_version
30   version2?
31   super
32 end
h2_version()
[show source]
   # File lib/sequel/adapters/jdbc/h2.rb
34 def h2_version
35   @h2_version ||= get(Sequel.function(:H2VERSION))
36 end
rollback_prepared_transaction(transaction_id, opts=OPTS)
[show source]
   # File lib/sequel/adapters/jdbc/h2.rb
38 def rollback_prepared_transaction(transaction_id, opts=OPTS)
39   run("ROLLBACK TRANSACTION #{transaction_id}", opts)
40 end
serial_primary_key_options()

H2 uses an IDENTITY type for primary keys

[show source]
   # File lib/sequel/adapters/jdbc/h2.rb
43 def serial_primary_key_options
44   {:primary_key => true, :type => :identity, :identity=>true}
45 end
supports_create_table_if_not_exists?()

H2 supports CREATE TABLE IF NOT EXISTS syntax

[show source]
   # File lib/sequel/adapters/jdbc/h2.rb
48 def supports_create_table_if_not_exists?
49   true
50 end
supports_prepared_transactions?()

H2 supports prepared transactions

[show source]
   # File lib/sequel/adapters/jdbc/h2.rb
53 def supports_prepared_transactions?
54   true
55 end
supports_savepoints?()

H2 supports savepoints

[show source]
   # File lib/sequel/adapters/jdbc/h2.rb
58 def supports_savepoints?
59   true
60 end