module Sequel::JDBC::H2::DatabaseMethods

  1. lib/sequel/adapters/jdbc/h2.rb
Parent: H2

Instance methods for H2 Database objects accessed via JDBC.

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  
PRIMARY_KEY_INDEX_RE = /\Aprimary_key/i.freeze  

Public Instance methods

commit_prepared_transaction (transaction_id)

Commit an existing prepared transaction with the given transaction identifier string.

[show source]
# File lib/sequel/adapters/jdbc/h2.rb, line 12
def commit_prepared_transaction(transaction_id)
  run("COMMIT TRANSACTION #{transaction_id}")
end
database_type ()

H2 uses the :h2 database type.

[show source]
# File lib/sequel/adapters/jdbc/h2.rb, line 17
def database_type
  :h2
end
rollback_prepared_transaction (transaction_id)

Rollback an existing prepared transaction with the given transaction identifier string.

[show source]
# File lib/sequel/adapters/jdbc/h2.rb, line 23
def rollback_prepared_transaction(transaction_id)
  run("ROLLBACK TRANSACTION #{transaction_id}")
end
serial_primary_key_options ()

H2 uses an IDENTITY type

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

H2 supports CREATE TABLE IF NOT EXISTS syntax.

[show source]
# File lib/sequel/adapters/jdbc/h2.rb, line 33
def supports_create_table_if_not_exists?
  true
end
supports_prepared_transactions? ()

H2 supports prepared transactions

[show source]
# File lib/sequel/adapters/jdbc/h2.rb, line 38
def supports_prepared_transactions?
  true
end
supports_savepoints? ()

H2 supports savepoints

[show source]
# File lib/sequel/adapters/jdbc/h2.rb, line 43
def supports_savepoints?
  true
end