Og 0.17.0 README

Og (ObjectGraph) is a powerfull object-relational mapping library. Og provides transparent serialization of object graphs to a RDBMS backend. Unlike other similar libraries Og maps standard Ruby objects to SQL tables and not vice versa. Og provides a meta language to describe the relations between objects, a flexible and intuitive api for querieng the database, raw access to the SQL language if needed (for example to fine tune the automatically generated SQL tables, or for custom queries), suports deserialization to Ruby objects or tuples, automatically generates join tables for many_to_many relations and provides a collection of usefull Mixins to synthesize common Entities.

Og is a combination of the best features of Active Record and the former O-R mapping library included in Nitro (NDB). Adapters for PostgreSQL, MySQL and SQLite are included.

Og is part of the Nitro project, released as a stand-alone library due to popular demand. You can find the ChangeLog in the Nitro distribution (nitro.rubyforge.org).

Features

The library provides the following features:

+ Object-Relational mapping. + Absolutely no configuration files. + Multiple stores (PostgreSQL, MySQL, SQLite, Oraclei, SqlServer, ..). + Supports non SQL stores. + ActiveRecord-style meta language and db aware methods. + Deserialize to Ruby Objects. + Deserialize sql join queries to Ruby Objects. + Eager associations. + Serialize arbitrary ruby object graphs through YAML. + Connection pooling. + Thread safety (temporarily dissabled). + SQL transactions. + Aspect oriented constructs allow interception of lifecycle callbacks. + Transparent support for cascading deletes for all backends. + Hierarchical structures (nested sets) + Works safely as part of distributed application. + Simple implementation.

What’s new

For information about the latest changes please consult the file

doc/RELEASES

Download

The latest version of Og can be found at

Documentation for Og can be found in the distribution. You can find a nice tutorial at www.rubygarden.com.

Requirements

Og requires the following applications or libraries:

  • Ruby 1.8.1 and greater

www.ruby-lang.org Version 1.8.2 is recomended.

  • Ruby-psql

www.postgresql.jp/interfaces/ruby/archive/ruby-postgres-0.7.1.tar.gz Ruby interface to the PostgreSQL RDBMS.

  • Ruby-mysql

tmtm.org/ja/ruby/mysql/README_en.html Ruby interface to the MySQL RDBMS. Pure Ruby Mysql interface: www.tmtm.org/ruby/mysql/

  • PostgreSQL

www.postgres.org Used for the Database Backend.

  • MySQL

www.mysql.org Used for the Database Backend.

  • SQLite

www.sqlite.org/download.html WARNING: you need sqlite3-ruby > 1.1.0

Please install the required applications and libraries before continuing with the installation of Og. Only install the libraries needed for the backend you plan to use.

Instalation

Og is distributed as a RubyGem. First of all make sure you have installed RubyGems on your system. Then run the following command:

gem install og

(make sure you have the latest stable versions of Ruby and RubyGems installed)

Then try to run the examples in the examples directory.

A tar.gz distribution is also available on www.rubyforge.com/projects/nitro.

Examples:

Some examples can be found in the examples directory. You are also encouraged to check out the unit tests. Especially the test:

test/og/tc_store.rb

demonstrates some advanced features of Og.

Support

For any questions regarding Og, feel free to ask on the ruby-talk mailing list (which is mirrored to comp.lang.ruby) or contact [email protected].

An Og specific mailing list is also available. Please subscribe to [email protected]. The homepage for this list is available here:

rubyforge.org/mailman/listinfo/nitro-general

Licence

Copyright © 2004-2005, George ‘tml’ Moschovitis. Copyright © 2004-2005, Navel Ltd (www.navel.gr)

Og (www.rubyforge.com/projects/nitro) is copyrighted free software created and maintained by George Moschovitis ([email protected]) and released under the standard BSD Licence. For details consult the file LICENCE.