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 204
204:         def case_expression_sql_append(sql, ce)
205:           super(sql, ce.with_merged_expression)
206:         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 211
211:         def cast_sql_append(sql, expr, type)
212:           if type == String
213:             sql << CAST_STRING_OPEN
214:             super
215:             sql << PAREN_CLOSE
216:           else
217:             super
218:           end
219:         end

[Source]

     # File lib/sequel/adapters/jdbc/derby.rb, line 221
221:         def complex_expression_sql_append(sql, op, args)
222:           case op
223:           when :%, 'B~''B~'
224:             complex_expression_emulate_append(sql, op, args)
225:           when :&, :|, :^, :<<, :>>
226:             raise Error, "Derby doesn't support the #{op} operator"
227:           when :**
228:             sql << 'exp('
229:             literal_append(sql, args[1])
230:             sql << ' * ln('
231:             literal_append(sql, args[0])
232:             sql << "))"
233:           when :extract
234:             sql << args.at(0).to_s << PAREN_OPEN
235:             literal_append(sql, args.at(1))
236:             sql << PAREN_CLOSE
237:           else
238:             super
239:           end
240:         end

Derby supports GROUP BY ROLLUP (but not CUBE)

[Source]

     # File lib/sequel/adapters/jdbc/derby.rb, line 243
243:         def supports_group_rollup?
244:           true
245:         end

Derby does not support IS TRUE.

[Source]

     # File lib/sequel/adapters/jdbc/derby.rb, line 248
248:         def supports_is_true?
249:           false
250:         end

Derby does not support IN/NOT IN with multiple columns

[Source]

     # File lib/sequel/adapters/jdbc/derby.rb, line 253
253:         def supports_multiple_column_in?
254:           false
255:         end

[Validate]