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 22
22:         def commit_prepared_transaction(transaction_id, opts=OPTS)
23:           run("COMMIT TRANSACTION #{transaction_id}", opts)
24:         end

H2 uses the :h2 database type.

[Source]

    # File lib/sequel/adapters/jdbc/h2.rb, line 27
27:         def database_type
28:           :h2
29:         end

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

[Source]

    # File lib/sequel/adapters/jdbc/h2.rb, line 33
33:         def rollback_prepared_transaction(transaction_id, opts=OPTS)
34:           run("ROLLBACK TRANSACTION #{transaction_id}", opts)
35:         end

H2 uses an IDENTITY type

[Source]

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

H2 supports CREATE TABLE IF NOT EXISTS syntax.

[Source]

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

H2 supports prepared transactions

[Source]

    # File lib/sequel/adapters/jdbc/h2.rb, line 48
48:         def supports_prepared_transactions?
49:           true
50:         end

H2 supports savepoints

[Source]

    # File lib/sequel/adapters/jdbc/h2.rb, line 53
53:         def supports_savepoints?
54:           true
55:         end

[Validate]