JDBC::Dataset
Emulate the case insensitive LIKE operator and the bitwise operators.
# File lib/sequel/adapters/jdbc/h2.rb, line 137 137: def complex_expression_sql_append(sql, op, args) 138: case op 139: when :ILIKE, :"NOT ILIKE" 140: super(sql, (op == :ILIKE ? :LIKE : :"NOT LIKE"), [SQL::PlaceholderLiteralString.new(ILIKE_PLACEHOLDER, [args.at(0)]), args.at(1)]) 141: when :&, :|, :^ 142: sql << complex_expression_arg_pairs(args){|a, b| literal(SQL::Function.new(BITWISE_METHOD_MAP[op], a, b))} 143: when :<< 144: sql << complex_expression_arg_pairs(args){|a, b| "(#{literal(a)} * POWER(2, #{literal(b)}))"} 145: when :>> 146: sql << complex_expression_arg_pairs(args){|a, b| "(#{literal(a)} / POWER(2, #{literal(b)}))"} 147: when :'B~' 148: sql << BITCOMP_OPEN 149: literal_append(sql, args.at(0)) 150: sql << BITCOMP_CLOSE 151: else 152: super 153: end 154: end
H2 doesn’t support IS TRUE
# File lib/sequel/adapters/jdbc/h2.rb, line 162 162: def supports_is_true? 163: false 164: end
H2 doesn’t support JOIN USING
# File lib/sequel/adapters/jdbc/h2.rb, line 167 167: def supports_join_using? 168: false 169: end
H2 doesn’t support multiple columns in IN/NOT IN
# File lib/sequel/adapters/jdbc/h2.rb, line 172 172: def supports_multiple_column_in? 173: false 174: end
Handle H2 specific clobs as strings.
# File lib/sequel/adapters/jdbc/h2.rb, line 187 187: def convert_type_proc(v) 188: if v.is_a?(Java::OrgH2Jdbc::JdbcClob) 189: H2_CLOB_METHOD 190: else 191: super 192: end 193: end
H2 expects hexadecimal strings for blob values
# File lib/sequel/adapters/jdbc/h2.rb, line 196 196: def literal_blob_append(sql, v) 197: sql << APOS << v.unpack(HSTAR).first << APOS 198: end
H2 handles fractional seconds in timestamps, but not in times
# File lib/sequel/adapters/jdbc/h2.rb, line 201 201: def literal_sqltime(v) 202: v.strftime(TIME_FORMAT) 203: end
Disabled; run with --debug to generate this.
Generated with the Darkfish Rdoc Generator 1.1.6.