Method: Libsql::TypeMaps::StorageMap#bind_type_of
- Defined in:
- lib/libsql/type_maps/storage_map.rb
#bind_type_of(obj) ⇒ Object
A straight logical mapping (for me at least) of basic Ruby classes to SQLite types, if nothing can be found then default to TEXT.
16 17 18 19 20 21 22 23 24 25 26 27 28 29 |
# File 'lib/libsql/type_maps/storage_map.rb', line 16 def bind_type_of( obj ) case obj when Float ::Libsql::SQLite3::Constants::DataType::FLOAT when Integer ::Libsql::SQLite3::Constants::DataType::INTEGER when NilClass ::Libsql::SQLite3::Constants::DataType::NULL when ::Libsql::Blob ::Libsql::SQLite3::Constants::DataType::BLOB else ::Libsql::SQLite3::Constants::DataType::TEXT end end |