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

Methods

Included Modules

::Sequel::JDBC::Transactions

Constants

DATABASE_ERROR_REGEXPS = { /The statement was aborted because it would have caused a duplicate key value in a unique or primary key constraint or unique index/ => UniqueConstraintViolation, /violation of foreign key constraint/ => ForeignKeyConstraintViolation, /The check constraint .+ was violated/ => CheckConstraintViolation, /cannot accept a NULL value/ => NotNullConstraintViolation, /A lock could not be obtained due to a deadlock/ => SerializationFailure, }.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 24
24:         def cast_type_literal(type)
25:           (type == String) ? 'CHAR(254)' : super
26:         end

[Source]

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

[Source]

    # File lib/sequel/adapters/jdbc/derby.rb, line 32
32:         def freeze
33:           svn_version
34:           super
35:         end

Derby uses an IDENTITY sequence for autoincrementing columns.

[Source]

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

Derby supports transactional DDL statements.

[Source]

    # File lib/sequel/adapters/jdbc/derby.rb, line 52
52:         def supports_transactional_ddl?
53:           true
54:         end

The SVN version of the database.

[Source]

    # File lib/sequel/adapters/jdbc/derby.rb, line 43
43:         def svn_version
44:           @svn_version ||= begin
45:             v = synchronize{|c| c.get_meta_data.get_database_product_version}
46:             v =~ /\((\d+)\)\z/
47:             $1.to_i
48:           end
49:         end

[Validate]