Module | Sequel::Postgres::PGRange::DatabaseMethods
In: | lib/sequel/extensions/pg_range.rb

### Methods

bound_variable_arg define_range_typecast_method extended

### Public Class methods

define_range_typecast_method(type, parser)

Define a private range typecasting method for the given type that uses the parser argument to do the type conversion.

[Source]

         # File lib/sequel/extensions/pg_range.rb, line 191
    191:         def self.define_range_typecast_method(type, parser)
    192:           meth = "typecast_value_#{type}""typecast_value_#{type}"
    193:           define_method(meth){|v| typecast_value_pg_range(v, parser)}
    194:           private meth
    195:         end

extended(db)

Reset the conversion procs if using the native postgres adapter, and extend the datasets to correctly literalize ruby Range values.

[Source]

         # File lib/sequel/extensions/pg_range.rb, line 185
    185:         def self.extended(db)
    186:           db.extend_datasets(DatasetMethods)
    187:         end

### Public Instance methods

bound_variable_arg(arg, conn)

Handle Range and PGRange values in bound variables

[Source]

         # File lib/sequel/extensions/pg_range.rb, line 198
    198:         def bound_variable_arg(arg, conn)
    199:           case arg
    200:           when PGRange
    201:             arg.unquoted_literal(schema_utility_dataset)
    202:           when Range
    203:             PGRange.from_range(arg).unquoted_literal(schema_utility_dataset)
    204:           else
    205:             super
    206:           end
    207:         end

[Validate]