Module FlexiRecord
In: lib/flexirecord.rb

Copyright (c) 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).

Classes and Modules

Module FlexiRecord::ListRecord
Class FlexiRecord::AbstractRecord
Class FlexiRecord::BaseRecord
Class FlexiRecord::Connection
Class FlexiRecord::ConnectionPool
Class FlexiRecord::DatabaseError
Class FlexiRecord::IsolationLevel
Class FlexiRecord::LockMode
Class FlexiRecord::ManyToOneReference
Class FlexiRecord::OneToOneReference
Class FlexiRecord::RecordArray
Class FlexiRecord::Reference
Class FlexiRecord::Relationship

Constants

DefaultTableAlias = '"obj"'.freeze   Quoted table alias used in SQL for the object to be selected.
RelationshipTableAlias = '"rel"'.freeze   Quoted table alias used in SQL for relationship entries in many-to-many relations.
RelationshipColumn = 'rel'.freeze   Property of objects fetched through many-to-many relations, which contain the relationship object.

[Validate]