Module: FlexiRecord

Defined in:
lib/flexirecord.rb

Overview

Copyright © 2007 FlexiGuided GmbH, Berlin

Author: Jan Behrens

Website: www.flexiguided.de/publications.flexirecord.en.html


FlexiRecord is a ruby library providing object oriented access to databases (object-relational mapping). Each table is represented by a class, each row of that table is represented by an object of that class. This library is especially aimed to properly support database transactions. By now only PostgreSQL (version 8.2 or higher!) is supported as a backend.

Please mind that this is a beta release.

To use FlexiRecord, you have to first create a new ConnectionPool with ConnectionPool.new. If all tables are stored on the same database, you can directly assign the ConnectionPool to the BaseRecord class, by calling:

FlexiRecord::BaseRecord.connection_pool = FlexiRecord::ConnectionPool.new(…)

You should also create sub-classes of BaseRecord, representing the tables of your database.

There is a demonstration of the usage of this library in the flexirecord-demo.rb file (module FlexiRecordDemo).

Defined Under Namespace

Modules: ListRecord Classes: AbstractRecord, BaseRecord, Connection, ConnectionPool, DatabaseError, IsolationLevel, LockMode, ManyToOneReference, OneToOneReference, RecordArray, Reference, Relationship

Constant Summary collapse

DefaultTableAlias =

Quoted table alias used in SQL for the object to be selected.

'"obj"'.freeze
RelationshipTableAlias =

Quoted table alias used in SQL for relationship entries in many-to-many relations.

'"rel"'.freeze
RelationshipColumn =

Property of objects fetched through many-to-many relations, which contain the relationship object.

'rel'.freeze