Method: Sequel::JDBC::Derby::Dataset#cast_sql_append

Defined in:
lib/sequel/adapters/jdbc/derby.rb

#cast_sql_append(sql, expr, type) ⇒ Object

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.



197
198
199
200
201
202
203
204
205
# File 'lib/sequel/adapters/jdbc/derby.rb', line 197

def cast_sql_append(sql, expr, type)
  if type == String
    sql << "RTRIM("
    super
    sql << ')'
  else
    super
  end
end