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. posted by tmcw at 4:29 PM 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 those two pages I've managed to get things working (albeit in a very very minimal manner, with just one simple query). posted by inigo2 at 2:08 PM on June 12, 2007
« Older
Buying a cheap Macbook Pro in ...
| An empty field. Nothing for mi...
Newer »
posted by tmcw at 4:29 PM on June 10, 2007