Module: Sequel::JDBC::H2::DatabaseMethods

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

Instance methods for H2 Database objects accessed via JDBC.

### Methods

alter_table_sql dataset serial_primary_key_options

### Public Instance methods

alter_table_sql(table, op)

H2 needs to add a primary key column as a constraint

[Source]

        # File lib/sequel_core/adapters/jdbc/h2.rb, line 8
     8:         def alter_table_sql(table, op)
     9:           case op[:op]
    10:           when :add_column
    11:             if op.delete(:primary_key)
    12:               sql = super(table, op)
    13:               [sql, "ALTER TABLE #{quote_schema_table(table)} ADD PRIMARY KEY (#{quote_identifier(op[:name])})"]
    14:             else
    15:               super(table, op)
    16:             end
    17:           else
    18:             super(table, op)
    19:           end
    20:         end

dataset(opts=nil)

Return Sequel::JDBC::H2::Dataset object with the given opts.

[Source]

        # File lib/sequel_core/adapters/jdbc/h2.rb, line 23
    23:         def dataset(opts=nil)
    24:           Sequel::JDBC::H2::Dataset.new(self, opts)
    25:         end

serial_primary_key_options()

H2 uses an IDENTITY type

[Source]

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

[Validate]