Class | Amalgalite::TypeMaps::DefaultMap
In: | lib/amalgalite/type_maps/default_map.rb lib/amalgalite/type_maps/default_map.rb
Parent: | Object

An Amalgalite::TypeMap that does its best to convert between Ruby classes and known SQL data types.

Upon instantiation, DefaultMap generates a conversion map to try to figure out the best way to convert between populate SQL ‘types’ and ruby classes

### Methods

bind_type_of bind_type_of blob blob boolean boolean date date datetime datetime float float integer integer new new result_value_of result_value_of string string time time

### Public Class methods

new()
new()

### Public Instance methods

bind_type_of( obj )

A straight logical mapping (for me at least) of basic Ruby classes to SQLite types, if nothing can be found then default to TEXT.

bind_type_of( obj )

A straight logical mapping (for me at least) of basic Ruby classes to SQLite types, if nothing can be found then default to TEXT.

blob( str )

convert a string to a blob

blob( str )

convert a string to a blob

boolean( str )

convert a string to true of false

boolean( str )

convert a string to true of false

date( str )

convert a string to a date

date( str )

convert a string to a date

datetime( str )

convert a string to a datetime, if no timzone is found in the parsed string, set it to the local offset.

datetime( str )

convert a string to a datetime, if no timzone is found in the parsed string, set it to the local offset.

float( str )

convert a string to a Float

float( str )

convert a string to a Float

integer( str )

convert an string to an Integer

integer( str )

convert an string to an Integer

result_value_of( declared_type, value )

Map the incoming value to an outgoing value. For some incoming values, there will be no change, but for some (i.e. Dates and Times) there is some conversion

result_value_of( declared_type, value )

Map the incoming value to an outgoing value. For some incoming values, there will be no change, but for some (i.e. Dates and Times) there is some conversion

string( str )

convert a string to a String, yes redundant I know.

string( str )

convert a string to a String, yes redundant I know.

time( str )

convert a string to a Time

time( str )

convert a string to a Time

[Validate]