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

Methods

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

[Source]

    # File lib/sequel/adapters/jdbc/h2.rb, line 17
17:         def commit_prepared_transaction(transaction_id, opts=OPTS)
18:           run("COMMIT TRANSACTION #{transaction_id}", opts)
19:         end

[Source]

    # File lib/sequel/adapters/jdbc/h2.rb, line 21
21:         def database_type
22:           :h2
23:         end

[Source]

    # File lib/sequel/adapters/jdbc/h2.rb, line 25
25:         def freeze
26:           h2_version
27:           super
28:         end

[Source]

    # File lib/sequel/adapters/jdbc/h2.rb, line 30
30:         def h2_version
31:           @h2_version ||= get(Sequel.function(:H2VERSION))
32:         end

[Source]

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

H2 uses an IDENTITY type for primary keys

[Source]

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

H2 supports CREATE TABLE IF NOT EXISTS syntax

[Source]

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

H2 supports prepared transactions

[Source]

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

H2 supports savepoints

[Source]

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

[Validate]