Module | Sequel::JDBC::Derby::DatabaseMethods |
In: |
lib/sequel/adapters/jdbc/derby.rb
|
PRIMARY_KEY_INDEX_RE | = | /\Asql\d+\z/i.freeze |
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 |
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.
# File lib/sequel/adapters/jdbc/derby.rb, line 29 29: def cast_type_literal(type) 30: (type == String) ? 'CHAR(254)' : super 31: end