Class Amalgalite::TypeMap
In: lib/amalgalite/type_map.rb
lib/amalgalite/type_map.rb
Parent: Object

TypeMap defines the protocol used between Ruby and SQLite for mapping binding types, used in prepared statements; and result types, used in returning objects from a query.

Methods

Public Instance methods

bind_type_of is called during the Statement#bind process to convert the bind parameter to the appropriate SQLite types. This method MUST return one of the valid constants in the namespace Amalgalite::SQLite::Constants::DataType

bind_type_of is called during the Statement#bind process to convert the bind parameter to the appropriate SQLite types. This method MUST return one of the valid constants in the namespace Amalgalite::SQLite::Constants::DataType

result_value_of is called during the result processing of column values to convert an SQLite database value into the appropriate Ruby class.

declared_type is the string from the original CREATE TABLE statment from which the column value originates. It may also be nil if the origin column cannot be determined.

value is the SQLite value from the column as either a Ruby String, Integer, Float or Amalgalite::Blob.

result_value should return the value that is to be put into the result set for the query. It may do nothing, or it may do massive amounts of conversion.

result_value_of is called during the result processing of column values to convert an SQLite database value into the appropriate Ruby class.

declared_type is the string from the original CREATE TABLE statment from which the column value originates. It may also be nil if the origin column cannot be determined.

value is the SQLite value from the column as either a Ruby String, Integer, Float or Amalgalite::Blob.

result_value should return the value that is to be put into the result set for the query. It may do nothing, or it may do massive amounts of conversion.

[Validate]