Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.lang.ruby > #3651
| From | Joel VanderWerf <joelvanderwerf@gmail.com> |
|---|---|
| Newsgroups | comp.lang.ruby |
| Subject | Re: Best gem for an existing mysql database |
| Date | 2011-04-28 14:42 -0500 |
| Organization | Service de news de lacave.net |
| Message-ID | <4DB9C32B.90608@gmail.com> (permalink) |
| References | <D7E6AB37-6DD2-49FA-A23F-C269E869CA78@gmail.com> |
On 04/28/2011 05:24 AM, Iain Barnett wrote: > Hi, > > I've an existing MySql database, and not having used any of the major database gems like ActiveRecord, Sequel etc etc I was wondering which one would work well against an already built DB ? > > The quicker I can get up and running the better. It would also be nice if I could bypass whatever sugar it has to run SQL directly, so I can just plug in any exising queries that are lying around. Sequel and AR will both let you drop to the SQL level, if the model level isn't quite right for what you want to do. I don't know about DataMapper or other ORMs. One thing I've always liked about sequel is that there is an intermediate level, between models and SQL: datasets with their chained query methods. Some examples: http://cheat.errtheblog.com/s/sequel The documentation for datasets: http://sequel.rubyforge.org/rdoc/files/doc/dataset_basics_rdoc.html Rather than use models, I often find it easier to think in relational terms and code in ruby, and that's what sequel's datasets let you do. Another factor to consider, when the database precedes the app, is whether the ORM layer supports the schema. IIUC, AR doesn't support composite primary keys without using an extra library. Sequel does support composite primary keys (this was very helpful to my team just in the last few weeks). This difference may not matter much, but it's something to be aware of. More on sequel's differences from AR: http://sequel.rubyforge.org/rdoc/files/doc/active_record_rdoc.html
Back to comp.lang.ruby | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread
Best gem for an existing mysql database Iain Barnett <iainspeed@gmail.com> - 2011-04-28 07:24 -0500
Re: Best gem for an existing mysql database Joel VanderWerf <joelvanderwerf@gmail.com> - 2011-04-28 14:42 -0500
Re: Best gem for an existing mysql database Iain Barnett <iainspeed@gmail.com> - 2011-04-28 16:16 -0500
csiph-web