Module | Sequel::JDBC::Derby::DatabaseMethods
In: | lib/sequel/adapters/jdbc/derby.rb

Instance methods for Derby Database objects accessed via JDBC.

### Methods

cast_type_literal database_type serial_primary_key_options svn_version

### Included Modules

::Sequel::JDBC::Transactions

### Constants

PRIMARY_KEY_INDEX_RE | = | /\Asql\d+\z/i.freeze

### Public Instance methods

cast_type_literal(type)

Derby doesn‘t support casting integer to varchar, only integer to char, and char(254) appears to have the widest support (with char(255) failing). This does add a bunch of extra spaces at the end, but those will be trimmed elsewhere.

[Source]

        # File lib/sequel/adapters/jdbc/derby.rb, line 17
    17:         def cast_type_literal(type)
    18:           (type == String) ? 'CHAR(254)' : super
    19:         end

database_type()

Derby uses the :derby database type.

[Source]

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

serial_primary_key_options()

Derby uses an IDENTITY sequence for autoincrementing columns.

[Source]

        # File lib/sequel/adapters/jdbc/derby.rb, line 27
    27:         def serial_primary_key_options
    28:           {:primary_key => true, :type => :integer, :identity=>true, :start_with=>1}
    29:         end

svn_version()

The SVN version of the database.

[Source]

        # File lib/sequel/adapters/jdbc/derby.rb, line 32
    32:         def svn_version
    33:           @svn_version ||= begin
    34:             v = synchronize{|c| c.get_meta_data.get_database_product_version}
    35:             v =~ /\((\d+)\)\z/
    36:             $1.to_i
    37:           end
    38:         end

[Validate]