Ruby and PostgreSQL?

P

pete

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!
 
C

Charles Johnson

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!
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
 
B

Ben Bleything

Not sure if this is the right place to post this, however I am looking
for documentation for using Ruby with a Postgres database. =A0I 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
 
S

Seebs

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
 
T

Tom Copeland

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:

http://railsonpostgresql.com/2009/09/04/rails-postgresql-and-database-drivers

To summarize, "gem install pg", and things are much better than they
were a few years ago :)

Yours,

Tom
 
M

Mike Stephens

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!
 

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

No members online now.

Forum statistics

Threads
473,781
Messages
2,569,616
Members
45,306
Latest member
TeddyWeath

Latest Threads

Top