Class Index [+]

Quicksearch

Sequel::Postgres::HStore::DatabaseMethods

Public Class Methods

extended(db) click to toggle source

Reset the conversion procs if using the native postgres adapter.

     # File lib/sequel/extensions/pg_hstore.rb, line 132
132:         def self.extended(db)
133:           db.reset_conversion_procs if db.respond_to?(:reset_conversion_procs)
134:         end

Public Instance Methods

bound_variable_arg(arg, conn) click to toggle source

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

Private Instance Methods

schema_column_type(db_type) click to toggle source

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_hstore(value) click to toggle source

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.

[Validate]

Generated with the Darkfish Rdoc Generator 1.1.6.