| Class | Amalgalite::TypeMaps::StorageMap |
| In: |
lib/amalgalite/type_maps/storage_map.rb
|
| Parent: | ::Amalgalite::TypeMap |
An Amalagliate TypeMap that has a one-to-one conversion between SQLite types and Ruby classes
A straight logical mapping (for me at least) of basic Ruby classes to SQLite types, if nothing can be found then default to TEXT.
# File lib/amalgalite/type_maps/storage_map.rb, line 19
19: def bind_type_of( obj )
20: case obj
21: when Float
22: ::Amalgalite::SQLite3::Constants::DataType::FLOAT
23: when Fixnum
24: ::Amalgalite::SQLite3::Constants::DataType::INTEGER
25: when NilClass
26: ::Amalgalite::SQLite3::Constants::DataType::NULL
27: when ::Amalgalite::Blob
28: ::Amalgalite::SQLite3::Constants::DataType::BLOB
29: else
30: ::Amalgalite::SQLite3::Constants::DataType::TEXT
31: end
32: end