Handle hstores in bound variables
# File lib/sequel/extensions/pg_hstore.rb, line 137 137: def bound_variable_arg(arg, conn) 138: case arg 139: when HStore 140: arg.unquoted_literal 141: when Hash 142: HStore.new(arg).unquoted_literal 143: else 144: super 145: end 146: end
Recognize the hstore database type.
# File lib/sequel/extensions/pg_hstore.rb, line 151 151: def schema_column_type(db_type) 152: db_type == 'hstore' ? :hstore : super 153: end
Typecast value correctly to HStore. If already an HStore instance, return as is. If a hash, return an HStore version of it. If a string, assume it is in PostgreSQL output format and parse it using the parser.
# File lib/sequel/extensions/pg_hstore.rb, line 160 160: def typecast_value_hstore(value) 161: case value 162: when HStore 163: value 164: when Hash 165: HStore.new(value) 166: when String 167: HStore.parse(value) 168: else 169: raise Sequel::InvalidValue, "invalid value for hstore: #{value.inspect}" 170: end 171: end
Disabled; run with --debug to generate this.
Generated with the Darkfish Rdoc Generator 1.1.6.