module Sequel::JDBC::Derby::DatabaseMethods

Constants

DATABASE_ERROR_REGEXPS

Public Instance Methods

cast_type_literal(type) click to toggle source

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.

Calls superclass method
   # File lib/sequel/adapters/jdbc/derby.rb
25 def cast_type_literal(type)
26   (type == String) ? 'CHAR(254)' : super
27 end
database_type() click to toggle source
   # File lib/sequel/adapters/jdbc/derby.rb
29 def database_type
30   :derby
31 end
freeze() click to toggle source
Calls superclass method Sequel::JDBC::Transactions#freeze
   # File lib/sequel/adapters/jdbc/derby.rb
33 def freeze
34   svn_version
35   super
36 end
serial_primary_key_options() click to toggle source

Derby uses an IDENTITY sequence for autoincrementing columns.

   # File lib/sequel/adapters/jdbc/derby.rb
39 def serial_primary_key_options
40   {:primary_key => true, :type => Integer, :identity=>true, :start_with=>1}
41 end
supports_transactional_ddl?() click to toggle source

Derby supports transactional DDL statements.

   # File lib/sequel/adapters/jdbc/derby.rb
53 def supports_transactional_ddl?
54   true
55 end
svn_version() click to toggle source

The SVN version of the database.

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