[Nitro] OG vs some other ORM packages

Mark Van De Vyver mvyver at gmail.com
Fri Aug 31 08:09:08 EDT 2007

Hi Kirk,

On 8/27/07, Kirk Haines <wyhaines at gmail.com> wrote:
> On 8/25/07, Mark Van De Vyver <mvyver at gmail.com> wrote:
> > Kansas (DBI)
> Kansas is my baby.  It's been around for a long time and is basically
> quite stable.  It uses DBI for the underlying db connectivity instead
> of reinventing the wheel there.

I've some questions about DBI and notice you're also listed as one of
its developers/maintainers, as well as the force behind DBI2!

Q1) Is there a definitive list of the DBD 'names' that are used to
make up DBIs' dsn?
On my system I have (/usr/lib/ruby/site_ruby/1.8/DBD/*) Mysql, ODBC,
but that is just 2/13 :)
I'd like to provide some documentation that is concrete for 'newbies',
i.e. if you've installed the ruby driver for db X, then to connect to
OG via the DBI adapter you should provide :dbi_driver => 'Xdrv' when
connecting to OG - the DBD (0.2.2 draft) documentation indicates this
'name' maybe case sensitive....?

Q2) Looking at DBIs project pages on Ruby-forge, there seem to be many
open bugs and patches, have all these really not been fixed/applied in
the latest release (August 12, 2006)?

Appreciate any light you can shed.


> It takes the approach of creating Ruby classes that correspond to
> database tables, and it tries to be fairly lightweight.  The code is
> not particularly large.
> It uses Ruby syntax to describe queries:
> sodiums = dbh.select(:Chemicals) {|c| c.name =~ '%sodium%'}
> critical_issues = dbh.select(:Roofs) {|r| r.sort_by(r.severity =>
> 'DESC'); r.severity > 3}
> It has transaction support that is not dependent on the database
> layer.  Queries can return results in normal ruby types such as an
> Array or Hash instead of the db-coupled Kansas result types.  The
> db-coupled objects can also be marked as read-only, so that changes to
> them do not get propagated back to the db.  It supports creating
> relationships between tables, for conveniences like:
> school = dbh.select(:Schools) {|s| s.name = school_we_are_looking_for }.first
> school_cyanides = school.inventory.select {|i| i.name =~ /cyanide/}
> art_inventory = school.departments.select {|d| d.name == 'Art'}.chemicals
> That's a basic high level view.  I have used it on dozens and dozens
> of sites over the years, and it just works.  I have a small community
> of users, and insufficient documentation, but it is in daily, active
> use, if not daily, active development.
> Kirk Haines

More information about the Nitro-general mailing list