Parent

Class/Module Index [+]

Quicksearch

Sequel::Amalgalite::SequelTypeMap

Type conversion map class for Sequel’s use of Amalgamite

Public Instance Methods

blob(s) click to toggle source

Return blobs as instances of Sequel::SQL::Blob instead of Amalgamite::Blob

# File lib/sequel/adapters/amalgalite.rb, line 20
def blob(s)
  SQL::Blob.new(s)
end
datetime(s) click to toggle source

Return datetime types as instances of Sequel.datetime_class

# File lib/sequel/adapters/amalgalite.rb, line 31
def datetime(s)
  Sequel.database_to_application_timestamp(s)
end
decimal(s) click to toggle source

Return numeric/decimal types as instances of BigDecimal instead of Float

# File lib/sequel/adapters/amalgalite.rb, line 26
def decimal(s)
  BigDecimal.new(s)
end
result_value_of(declared_type, value) click to toggle source

Don’t raise an error if the value is a string and the declared type doesn’t match a known type, just return the value.

# File lib/sequel/adapters/amalgalite.rb, line 37
def result_value_of(declared_type, value)
  if value.is_a?(::Amalgalite::Blob)
    SQL::Blob.new(value.source)
  elsif value.is_a?(String) && declared_type
    (meth = self.class.sql_to_method(declared_type.downcase)) ? send(meth, value) : value
  else
    super
  end
end

[Validate]

Generated with the Darkfish Rdoc Generator 2.