### Home Classes Methods

### In Files

- lib/amalgalite/type_map.rb

### Parent

Object

### Methods

- #bind_type_of
- #result_value_of

### Files

- HISTORY.rdoc
- LICENSE
- README.rdoc

### Class/Module Index

Quicksearch

- Amalgalite
- Amalgalite::Aggregate
- Amalgalite::Blob
- Amalgalite::Blob::Error
- Amalgalite::Boolean
- Amalgalite::BusyHandler
- Amalgalite::BusyTimeout
- Amalgalite::CSVTableImporter
- Amalgalite::Column
- Amalgalite::Database
- Amalgalite::Database::AggregateError
- Amalgalite::Database::BusyHandlerError
- Amalgalite::Database::FunctionError
- Amalgalite::Database::InvalidModeError
- Amalgalite::Database::ProgressHandlerError
- Amalgalite::Database::TransactionBehavior
- Amalgalite::Error
- Amalgalite::Function
- Amalgalite::Index
- Amalgalite::MemoryDatabase
- Amalgalite::Packer
- Amalgalite::Paths
- Amalgalite::ProfileSampler
- Amalgalite::ProfileTap
- Amalgalite::ProgressHandler
- Amalgalite::Requires
- Amalgalite::SQLite3
- Amalgalite::SQLite3::Constants
- Amalgalite::SQLite3::Constants::Config
- Amalgalite::SQLite3::Constants::DBStatus
- Amalgalite::SQLite3::Constants::DataType
- Amalgalite::SQLite3::Constants::Helpers
- Amalgalite::SQLite3::Constants::Open
- Amalgalite::SQLite3::Constants::ResultCode
- Amalgalite::SQLite3::Constants::StatementStatus
- Amalgalite::SQLite3::Constants::Status
- Amalgalite::SQLite3::Database
- Amalgalite::SQLite3::Database::DBStatus
- Amalgalite::SQLite3::Database::Function
- Amalgalite::SQLite3::Database::Stat
- Amalgalite::SQLite3::Stat
- Amalgalite::SQLite3::Status
- Amalgalite::SQLite3::Version
- Amalgalite::Schema
- Amalgalite::Statement
- Amalgalite::Table
- Amalgalite::Taps
- Amalgalite::Taps::IO
- Amalgalite::Taps::Stderr
- Amalgalite::Taps::Stdout
- Amalgalite::Taps::StringIO
- Amalgalite::TraceTap
- Amalgalite::TypeMap
- Amalgalite::TypeMaps
- Amalgalite::TypeMaps::DefaultMap
- Amalgalite::TypeMaps::StorageMap
- Amalgalite::TypeMaps::TextMap
- Amalgalite::Version
- Amalgalite::View
- Kernel
- Object

No matching classes.

# Amalgalite::TypeMap

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.

### Public Instance Methods

bind_type_of( obj ) → DataType constant click to toggle source

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

    # File lib/amalgalite/type_map.rb, line 22
    def bind_type_of( obj )
      raise NotImplementedError, "bind_type_of has not been implemented"
    end

result_value_of( declared_type, value ) → String click to toggle source

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.

    # File lib/amalgalite/type_map.rb, line 43
    def result_value_of( delcared_type, value )
      raise NotImplementedError, "result_value_of has not been implemented"
    end

[Validate]

Generated with the Darkfish Rdoc Generator 2.