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
BITCOMP_OPEN = "((0 - ".freeze
BITCOMP_CLOSE = ") - 1)".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
SELECT_CLAUSE_METHODS = clause_methods(:select, %w'select distinct columns from join where group having compounds order limit lock')
EMULATED_FUNCTION_MAP = {:char_length=>'length'.freeze}
JAVA_SQL_CLOB = Java::JavaSQL::Clob
DERBY_CLOB_METHOD = TYPE_TRANSLATOR_INSTANCE.method(:derby_clob)

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 196
196:         def case_expression_sql_append(sql, ce)
197:           super(sql, ce.with_merged_expression)
198:         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 203
203:         def cast_sql_append(sql, expr, type)
204:           if type == String
205:             sql << CAST_STRING_OPEN
206:             super
207:             sql << PAREN_CLOSE
208:           else
209:             super
210:           end
211:         end

[Source]

     # File lib/sequel/adapters/jdbc/derby.rb, line 213
213:         def complex_expression_sql_append(sql, op, args)
214:           case op
215:           when :%
216:             sql << complex_expression_arg_pairs(args){|a, b| "MOD(#{literal(a)}, #{literal(b)})"}
217:           when :&, :|, :^, :<<, :>>
218:             raise Error, "Derby doesn't support the #{op} operator"
219:           when 'B~''B~'
220:             sql << BITCOMP_OPEN
221:             literal_append(sql, args.at(0))
222:             sql << BITCOMP_CLOSE
223:           when :extract
224:             sql << args.at(0).to_s << PAREN_OPEN
225:             literal_append(sql, args.at(1))
226:             sql << PAREN_CLOSE
227:           else
228:             super
229:           end
230:         end

Derby supports GROUP BY ROLLUP (but not CUBE)

[Source]

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

Derby does not support IS TRUE.

[Source]

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

Derby does not support IN/NOT IN with multiple columns

[Source]

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

[Validate]