Class Sequel::JDBC::Derby::Dataset
In: lib/sequel/adapters/jdbc/derby.rb
Parent: JDBC::Dataset

Dataset class for Derby datasets accessed via JDBC.

Methods

Constants

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}

Public Instance methods

Derby doesn‘t support an expression between CASE and WHEN, so remove conditions.

[Source]

     # File lib/sequel/adapters/jdbc/derby.rb, line 202
202:         def case_expression_sql_append(sql, ce)
203:           super(sql, ce.with_merged_expression)
204:         end

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.

[Source]

     # 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

[Source]

     # 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

Derby supports GROUP BY ROLLUP (but not CUBE)

[Source]

     # File lib/sequel/adapters/jdbc/derby.rb, line 235
235:         def supports_group_rollup?
236:           true
237:         end

Derby does not support IS TRUE.

[Source]

     # File lib/sequel/adapters/jdbc/derby.rb, line 240
240:         def supports_is_true?
241:           false
242:         end

Derby does not support IN/NOT IN with multiple columns

[Source]

     # File lib/sequel/adapters/jdbc/derby.rb, line 245
245:         def supports_multiple_column_in?
246:           false
247:         end

[Validate]