Options for working with PostgreSQL?...

F

Fab

Hi,

I'm going to be working on a Ruby project that needs to access
and update an existing PostgreSQL database.

I'd like to hear from people who have done or are doing this
about their choice of Ruby access method to PostgreSQL. There
seems to be DBI, Og, ActiveRecord, and others?

Any advice much appreciated!

Fab
 
M

Mohit Muthanna

Fab,

It all depends on how you want to access your database and what you
wish to do with it.

DBI - Driect SQL Access. Database Independent. Similar to Perl::DBI.

Postgres - Direct SQL Access. Specifically for PostgreSQL. DBI uses this mo=
dule.

Og - Object-Relational Mapping. Generates SQL statements. You can have
direct SQL access with Og, but that's not what it's meant for. This
one is my favourite.

ActiveRecord - This is used by Rails. I haven't worked with it much,
but I believe it's similar to Og.

Anyhow, if all you want to do is throw a few SQL statements together,
you're probably better off with DBI or Postgres. I'd pick the former
mainly because it would _try to_ keep you from doing Postgres specific
things; easing a port to another db, if ever needed.

If you're building a database driven application, I'd strongly
recommend that you investigate Og. Og lets you continue to think in
terms of classes and objects, while it takes care of the database side
of things (Generating the database model, SQL queries etc.)

It certainly eases development effort considerably; and also leads to
cleaner more-manageable code.

The only negatives with Og, IMO, is the lack of good documentation.

I haven't worked with ActiveRecord much, but I'm sure someone here
will help you with that.

Mohit.


Hi,
=20
I'm going to be working on a Ruby project that needs to access
and update an existing PostgreSQL database.
=20
I'd like to hear from people who have done or are doing this
about their choice of Ruby access method to PostgreSQL. There
seems to be DBI, Og, ActiveRecord, and others?
=20
Any advice much appreciated!
=20
Fab
=20
=20


--=20
Mohit Muthanna [mohit (at) muthanna (uhuh) com]
"There are 10 types of people. Those who understand binary, and those
who don't."
 
G

George Moschovitis

Og - Object-Relational Mapping. Generates SQL statements. You can have
direct SQL access with Og, but that's not what it's meant for. This
one is my favourite.

Allow me to add that the latest version of Og can also 'reverse
engineer' a legacy database schema and provide an OO view of your
tables.

regards,
George
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,770
Messages
2,569,583
Members
45,075
Latest member
MakersCBDBloodSupport

Latest Threads

Top