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

Instance methods for Derby Database objects accessed via JDBC.

Methods

Included Modules

::Sequel::JDBC::Transactions

Constants

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

Public Instance methods

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

Derby uses the :derby database type.

[Source]

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

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

Derby supports transaction DDL statements.

[Source]

    # File lib/sequel/adapters/jdbc/derby.rb, line 41
41:         def supports_transactional_ddl?
42:           true
43:         end

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]