Override the default SqlAnywhere.convert_smallint_to_bool setting for this dataset.
SQLAnywhere uses + for string concatenation, and LIKE is case insensitive by default.
# File lib/sequel/adapters/shared/sqlanywhere.rb, line 316 def complex_expression_sql_append(sql, op, args) case op when :'||' super(sql, :+, args) when :<<, :>> complex_expression_emulate_append(sql, op, args) when :LIKE, :"NOT LIKE" sql << Sequel::Dataset::PAREN_OPEN literal_append(sql, args.at(0)) sql << Sequel::Dataset::SPACE << (op == :LIKE ? REGEXP : NOT_REGEXP) << Sequel::Dataset::SPACE pattern = '' last_c = '' args.at(1).each_char do |c| if c == '_' and not pattern.end_with?('\') and last_c != '\' pattern << '.' elsif c == '%' and not pattern.end_with?('\') and last_c != '\' pattern << '.*' elsif c == '[' and not pattern.end_with?('\') and last_c != '\' pattern << '\[' elsif c == ']' and not pattern.end_with?('\') and last_c != '\' pattern << '\]' elsif c == '*' and not pattern.end_with?('\') and last_c != '\' pattern << '\*' elsif c == '?' and not pattern.end_with?('\') and last_c != '\' pattern << '\?' else pattern << c end if c == '\' and last_c == '\' last_c = '' else last_c = c end end literal_append(sql, pattern) sql << Sequel::Dataset::ESCAPE literal_append(sql, Sequel::Dataset::BACKSLASH) sql << Sequel::Dataset::PAREN_CLOSE when :ILIKE, :"NOT ILIKE" super(sql, (op == :ILIKE ? :LIKE : :"NOT LIKE"), args) when :extract sql << DATEPART + Sequel::Dataset::PAREN_OPEN literal_append(sql, args.at(0)) sql << ',' literal_append(sql, args.at(1)) sql << Sequel::Dataset::PAREN_CLOSE else super end end
Use Date() and Now() for CURRENT_DATE and CURRENT_TIMESTAMP
# File lib/sequel/adapters/shared/sqlanywhere.rb, line 373 def constant_sql_append(sql, constant) case constant when :CURRENT_DATE sql << DATE_FUNCTION when :CURRENT_TIMESTAMP, :CURRENT_TIME sql << NOW_FUNCTION else super end end
Whether to convert smallint to boolean arguments for this dataset. Defaults to the SqlAnywhere module setting.
# File lib/sequel/adapters/shared/sqlanywhere.rb, line 274 def convert_smallint_to_bool defined?(@convert_smallint_to_bool) ? @convert_smallint_to_bool : (@convert_smallint_to_bool = @db.convert_smallint_to_bool) end
Uses CROSS APPLY to join the given table into the current dataset.
# File lib/sequel/adapters/shared/sqlanywhere.rb, line 306 def cross_apply(table) join_table(:cross_apply, table) end
SqlAnywhere uses \ to escape metacharacters, but a ']' should not be escaped
# File lib/sequel/adapters/shared/sqlanywhere.rb, line 368 def escape_like(string) string.gsub(/[\\%_\[]/){|m| "\\#{m}"} end
Specify a table for a SELECT … INTO query.
# File lib/sequel/adapters/shared/sqlanywhere.rb, line 385 def into(table) clone(:into => table) end
SqlAnywhere requires recursive CTEs to have column aliases.
# File lib/sequel/adapters/shared/sqlanywhere.rb, line 311 def recursive_cte_requires_column_aliases? true end
# File lib/sequel/adapters/shared/sqlanywhere.rb, line 281 def supports_cte?(type=:select) type == :select || type == :insert end
# File lib/sequel/adapters/shared/sqlanywhere.rb, line 293 def supports_is_true? false end
# File lib/sequel/adapters/shared/sqlanywhere.rb, line 297 def supports_join_using? false end
# File lib/sequel/adapters/shared/sqlanywhere.rb, line 285 def supports_multiple_column_in? false end
Generated with the Darkfish Rdoc Generator 2.