Class Og::SqliteBackend
In: lib/og/backends/sqlite.rb
Parent: Backend

Implements an SQLite powered backend.

Methods

Constants

TYPEMAP = { Integer => 'integer', Fixnum => 'integer', Float => 'float', String => 'text', Time => 'timestamp', Date => 'date', TrueClass => 'boolean', Object => 'text', Array => 'text', Hash => 'text'   A mapping between Ruby and SQL types.

Public Class methods

generate the mapping of the database fields to the object properties.

Output YYY-mm-dd TODO: Optimize this

Escape an SQL string

Generate the property for oid

Returns the code that actually inserts the object into the database. Returns the code as String.

Intitialize the connection to the RDBMS.

Input YYYY-mm-dd TODO: Optimize this

Parse sql datetime TODO: Optimize this

Return an evaluator for reading the property. No need to optimize this, used only to precalculate code.

Convert a ruby time to an sql timestamp. TODO: Optimize this

Return an sql string evaluator for the property. No need to optimize this, used only to precalculate code. YAML is used to store general Ruby objects to be more portable.

FIXME: add extra handling for float.

Public Instance methods

Create the managed object table. The properties of the object are mapped to the table columns. Additional sql relations and constrains are created (indicices, sequences, etc).

Deserialize all rows of the resultset.

Deserialize one row of the resultset.

Drop the managed object table.

Execute an SQL query, no result returned.

Return a single integer value from the resultset.

Execute an SQL query and return the result.

Execute an SQL query, no result returned. Wrapped in a rescue block.

Execute an SQL query and return the result. Wrapped in a rescue block.

Check if it is a valid resultset.

[Validate]