Class: Sequel::JDBC::Derby::Dataset
- Includes:
- Dataset::ColumnsLimit1
- Defined in:
- lib/sequel/adapters/jdbc/derby.rb
Constant Summary
Constants included from Dataset::ColumnsLimit1
Dataset::ColumnsLimit1::COLUMNS_CLONE_OPTIONS
Instance Method Summary collapse
-
#case_expression_sql_append(sql, ce) ⇒ Object
Derby doesn't support an expression between CASE and WHEN, so remove conditions.
-
#cast_sql_append(sql, expr, type) ⇒ Object
If the type is String, trim the extra spaces since CHAR is used instead of varchar.
- #complex_expression_sql_append(sql, op, args) ⇒ Object
-
#supports_group_rollup? ⇒ Boolean
Derby supports GROUP BY ROLLUP (but not CUBE).
-
#supports_is_true? ⇒ Boolean
Derby does not support IS TRUE.
-
#supports_merge? ⇒ Boolean
Derby 10.11+ supports MERGE.
-
#supports_multiple_column_in? ⇒ Boolean
Derby does not support IN/NOT IN with multiple columns.
Methods included from Dataset::ColumnsLimit1
Instance Method Details
#case_expression_sql_append(sql, ce) ⇒ Object
Derby doesn't support an expression between CASE and WHEN, so remove conditions.
192 193 194 |
# File 'lib/sequel/adapters/jdbc/derby.rb', line 192 def case_expression_sql_append(sql, ce) super(sql, ce.with_merged_expression) end |
#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.
199 200 201 202 203 204 205 206 207 |
# File 'lib/sequel/adapters/jdbc/derby.rb', line 199 def cast_sql_append(sql, expr, type) if type == String sql << "RTRIM(" super sql << ')' else super end end |
#complex_expression_sql_append(sql, op, args) ⇒ Object
209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 |
# File 'lib/sequel/adapters/jdbc/derby.rb', line 209 def complex_expression_sql_append(sql, op, args) case op when :%, :'B~' complex_expression_emulate_append(sql, op, args) when :&, :|, :^, :<<, :>> raise Error, "Derby doesn't support the #{op} operator" when :** sql << 'exp(' literal_append(sql, args[1]) sql << ' * ln(' literal_append(sql, args[0]) sql << "))" when :extract sql << args[0].to_s << '(' literal_append(sql, args[1]) sql << ')' else super end end |
#supports_group_rollup? ⇒ Boolean
Derby supports GROUP BY ROLLUP (but not CUBE)
231 232 233 |
# File 'lib/sequel/adapters/jdbc/derby.rb', line 231 def supports_group_rollup? true end |
#supports_is_true? ⇒ Boolean
Derby does not support IS TRUE.
236 237 238 |
# File 'lib/sequel/adapters/jdbc/derby.rb', line 236 def supports_is_true? false end |
#supports_merge? ⇒ Boolean
Derby 10.11+ supports MERGE.
241 242 243 |
# File 'lib/sequel/adapters/jdbc/derby.rb', line 241 def supports_merge? db.svn_version >= 1616546 end |
#supports_multiple_column_in? ⇒ Boolean
Derby does not support IN/NOT IN with multiple columns
246 247 248 |
# File 'lib/sequel/adapters/jdbc/derby.rb', line 246 def supports_multiple_column_in? false end |