Ruby and PostgreSQL?

Hi-

Not sure if this is the right place to post this, however I am looking
for documentation for using Ruby with a Postgres database. I found
the ruby-pg gem, however nothing in the way of docs and Google isn’t
giving me much.

Anyone have any experience with this?

Thanks!

On Mon, Sep 28, 2009 at 8:25 AM, pete [email protected] wrote:

Not sure if this is the right place to post this, however I am looking
for documentation for using Ruby with a Postgres database. I found
the ruby-pg gem, however nothing in the way of docs and Google isn’t
giving me much.

ruby-pg has pretty good rdoc, which you can view locally with gem server.

Ben

On Sep 28, 2009, at 10:25 AM, pete wrote:

You will want the “pg” gem as opposed to the ruby-pg gem for a start.
You did not specify your platform, but you will need a compiler to
install the gem. There is a pure ruby connector for postgres: postgres-
pr which provides the same functionality though with slower performance.

You can start here for documentation on the functionality available.

Cheers–

Charles

On Sep 28, 9:46 am, Ben B. [email protected] wrote:

On Mon, Sep 28, 2009 at 8:25 AM, pete [email protected] wrote:

Not sure if this is the right place to post this, however I am looking
for documentation for using Ruby with a Postgres database. I found
the ruby-pg gem, however nothing in the way of docs and Google isn’t
giving me much.

ruby-pg has pretty good rdoc, which you can view locally with gem server.

Ben

I didn’t even know that existed, awesome, thanks!

On 2009-09-28, pete [email protected] wrote:

Not sure if this is the right place to post this, however I am looking
for documentation for using Ruby with a Postgres database. I found
the ruby-pg gem, however nothing in the way of docs and Google isn’t
giving me much.

Hi! There should be documentation; try running rdoc in the source tree,
according to google. I did “rdoc --op foo”, and foo/index.html yielded
a moderately usable hunk of documentation.

I was using this for a while (enough to find and submit a fix for a very
ugly memory corruption bug), but now I don’t directly use it, rather, I
have it embedded in Rails and use it through ActiveRecord.

-s

On Sep 28, 2009, at 11:39 AM, Charles J. wrote:

You will want the “pg” gem as opposed to the ruby-pg gem for a
start. You did not specify your platform, but you will need a
compiler to install the gem. There is a pure ruby connector for
postgres: postgres-pr which provides the same functionality though
with slower performance.

I posted a little roundup of Ruby PostgreSQL drivers recently:

To summarize, “gem install pg”, and things are much better than they
were a few years ago :slight_smile:

Yours,

Tom

And of course you can write stored procedures with PL/Ruby - no need for
that old fashioned business logic layer - stick everything in the
database!