Class | Sequel::JDBC::HSQLDB::Dataset
In: | lib/sequel/adapters/jdbc/hsqldb.rb
Parent: | JDBC::Dataset

Dataset class for HSQLDB datasets accessed via JDBC.

### Methods

complex_expression_sql_append recursive_cte_requires_column_aliases? supports_is_true?

### Constants

BITWISE_METHOD_MAP | = | {:& =>:BITAND, :| => :BITOR, :^ => :BITXOR}
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') |  | HSQLDB does support common table expressions, but the support is broken. CTEs operate more like temprorary tables or views, lasting longer than the duration of the expression. CTEs in earlier queries might take precedence over CTEs with the same name in later queries. Also, if any CTE is recursive, all CTEs must be recursive. If you want to use CTEs with HSQLDB, you‘ll have to manually modify the dataset to allow it.
SQL_WITH_RECURSIVE | = | "WITH RECURSIVE ".freeze
APOS | = | Dataset::APOS
HSTAR | = | "H*".freeze
BLOB_OPEN | = | "X'".freeze
BITCOMP_OPEN | = | "((0 - ".freeze
BITCOMP_CLOSE | = | ") - 1)".freeze
DEFAULT_FROM | = | " FROM (VALUES (0))".freeze
TIME_FORMAT | = | "'%H:%M:%S'".freeze

### Public Instance methods

complex_expression_sql_append(sql, op, args)

Handle HSQLDB specific case insensitive LIKE and bitwise operator support.

[Source]

         # File lib/sequel/adapters/jdbc/hsqldb.rb, line 109
    109:         def complex_expression_sql_append(sql, op, args)
    110:           case op
    111:           when :ILIKE, "NOT ILIKE""NOT ILIKE"
    112:             super(sql, (op == :ILIKE ? :LIKE : "NOT LIKE""NOT LIKE"), [SQL::Function.new(:ucase, args.at(0)), SQL::Function.new(:ucase, args.at(1)) ])
    113:           when :&, :|, :^
    114:             op = BITWISE_METHOD_MAP[op]
    115:             sql << complex_expression_arg_pairs(args){|a, b| literal(SQL::Function.new(op, a, b))}
    116:           when :<<
    117:             sql << complex_expression_arg_pairs(args){|a, b| "(#{literal(a)} * POWER(2, #{literal(b)}))"}
    118:           when :>>
    119:             sql << complex_expression_arg_pairs(args){|a, b| "(#{literal(a)} / POWER(2, #{literal(b)}))"}
    120:           when :%
    121:             sql << complex_expression_arg_pairs(args){|a, b| "MOD(#{literal(a)}, #{literal(b)})"}
    122:           when 'B~''B~'
    123:             sql << BITCOMP_OPEN
    124:             literal_append(sql, args.at(0))
    125:             sql << BITCOMP_CLOSE
    126:           else
    127:             super
    128:           end
    129:         end

recursive_cte_requires_column_aliases?()

HSQLDB requires recursive CTEs to have column aliases.

[Source]

         # File lib/sequel/adapters/jdbc/hsqldb.rb, line 132
    132:         def recursive_cte_requires_column_aliases?
    133:           true
    134:         end

supports_is_true?()

HSQLDB does not support IS TRUE.

[Source]

         # File lib/sequel/adapters/jdbc/hsqldb.rb, line 137
    137:         def supports_is_true?
    138:           false
    139:         end

[Validate]