querying the hive mind
We have lots of great conversations, we'd love you to
join us, click here.
How to query SQL with Ruby?
June 10, 2007
What's the best way (using the internet, and/or books) to learn how to query SQL databases with Ruby?
Computers & Internet
(3 answers total)
1 user marked this as a favorite
The syntax of how to make a query will differ greatly depending on which adapter you're using to connect to the database (SQLite, MySQL, Postgres, etc.), at least in my experience. If you're using a framework like rails, the ruby syntax for queries wil be more standardized, so it's just a matter of learning that. So, generally my answer is to google for the ruby driver for the database you plan to use, and then google for docs on how to make queries with that driver.
on June 10, 2007
The best way is to use the ActiveRecord gem bundled with Ruby on Rails. Any Ruby on Rails tutorial or book (I suggest Agile Web Development with Ruby on Rails) will be able to teach you the basics of ActiveRecord use. You can then just "drop" this functionality into your Ruby scripts.
I also have a very very very short wiki introduction to using it:
Using ActiveRecord in regular Ruby scripts
on June 10, 2007
I've just finished trying to learn how make a small ruby app that will query an Oracle DB. A couple pages I found helpful:
"Connecting Ruby to Oracle" from about.com
Ruby on Rails With Oracle
Using those two pages I've managed to get things working (albeit in a very very minimal manner, with just one simple query).
on June 12, 2007
Buying Macbook Pro in Canada | Bullet Theory (Not JFK related).
This thread is closed to new comments.
Moving from PostgreSQL to SalesForce with Rails 3
July 19, 2012
Monolingual no more
January 7, 2011
Other frameworks akin to Ruby on Rails?
July 6, 2007
How can I build a database and interface for a...
August 9, 2006
"There's no place like home...."
June 27, 2006