Class | Sequel::JDBC::Derby::Dataset |
In: |
lib/sequel/adapters/jdbc/derby.rb
|
Parent: | JDBC::Dataset |
PAREN_CLOSE | = | Dataset::PAREN_CLOSE |
PAREN_OPEN | = | Dataset::PAREN_OPEN |
OFFSET | = | Dataset::OFFSET |
CAST_STRING_OPEN | = | "RTRIM(".freeze |
BLOB_OPEN | = | "CAST(X'".freeze |
BLOB_CLOSE | = | "' AS BLOB)".freeze |
HSTAR | = | "H*".freeze |
TIME_FORMAT | = | "'%H:%M:%S'".freeze |
DEFAULT_FROM | = | " FROM sysibm.sysdummy1".freeze |
ROWS | = | " ROWS".freeze |
FETCH_FIRST | = | " FETCH FIRST ".freeze |
ROWS_ONLY | = | " ROWS ONLY".freeze |
BOOL_TRUE_OLD | = | '(1 = 1)'.freeze |
BOOL_FALSE_OLD | = | '(1 = 0)'.freeze |
BOOL_TRUE | = | 'TRUE'.freeze |
BOOL_FALSE | = | 'FALSE'.freeze |
EMULATED_FUNCTION_MAP | = | {:char_length=>'length'.freeze} |
If the type is String, trim the extra spaces since CHAR is used instead of varchar. This can cause problems if you are casting a char/varchar to a string and the ending whitespace is important.
# File lib/sequel/adapters/jdbc/derby.rb, line 209 209: def cast_sql_append(sql, expr, type) 210: if type == String 211: sql << CAST_STRING_OPEN 212: super 213: sql << PAREN_CLOSE 214: else 215: super 216: end 217: end
# File lib/sequel/adapters/jdbc/derby.rb, line 219 219: def complex_expression_sql_append(sql, op, args) 220: case op 221: when :%, 'B~''B~' 222: complex_expression_emulate_append(sql, op, args) 223: when :&, :|, :^, :<<, :>> 224: raise Error, "Derby doesn't support the #{op} operator" 225: when :extract 226: sql << args.at(0).to_s << PAREN_OPEN 227: literal_append(sql, args.at(1)) 228: sql << PAREN_CLOSE 229: else 230: super 231: end 232: end