Module Sequel::JDBC::H2::DatabaseMethods
In: lib/sequel/adapters/jdbc/h2.rb

Instance methods for H2 Database objects accessed via JDBC.

Methods

Constants

PRIMARY_KEY_INDEX_RE = /\Aprimary_key/i.freeze
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 an existing prepared transaction with the given transaction identifier string.

[Source]

    # File lib/sequel/adapters/jdbc/h2.rb, line 12
12:         def commit_prepared_transaction(transaction_id)
13:           run("COMMIT TRANSACTION #{transaction_id}")
14:         end

H2 uses the :h2 database type.

[Source]

    # File lib/sequel/adapters/jdbc/h2.rb, line 17
17:         def database_type
18:           :h2
19:         end

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

[Source]

    # File lib/sequel/adapters/jdbc/h2.rb, line 23
23:         def rollback_prepared_transaction(transaction_id)
24:           run("ROLLBACK TRANSACTION #{transaction_id}")
25:         end

H2 uses an IDENTITY type

[Source]

    # File lib/sequel/adapters/jdbc/h2.rb, line 28
28:         def serial_primary_key_options
29:           {:primary_key => true, :type => :identity, :identity=>true}
30:         end

H2 supports CREATE TABLE IF NOT EXISTS syntax.

[Source]

    # File lib/sequel/adapters/jdbc/h2.rb, line 33
33:         def supports_create_table_if_not_exists?
34:           true
35:         end

H2 supports prepared transactions

[Source]

    # File lib/sequel/adapters/jdbc/h2.rb, line 38
38:         def supports_prepared_transactions?
39:           true
40:         end

H2 supports savepoints

[Source]

    # File lib/sequel/adapters/jdbc/h2.rb, line 43
43:         def supports_savepoints?
44:           true
45:         end

[Validate]