News for hackers. Stuff that matters.
Re:Sqlphobia: The Irrational Fear of SQL by sid0 on Sunday April 04, 2010 @04:35PM (#1240772)
His comment about ORM is interesting. I'm about to start a small database project for my class, and we've chosen web.py to work with. To us web.py seems like the right level of abstraction -- it allows us to do simple things with a nice pythonic syntax, but stays out of the way and allows us to use raw SQL for joins and such. (I can't even imagine how a full-blown ORM would represent joins!)
Re:Sqlphobia: The Irrational Fear of SQL by Lewisham on Sunday April 04, 2010 @05:45PM (#1240877)
The way I think about ORM is that I'm navigating through a data structure. The ORMs I've used (DBIx::Class, SqlAlchemy) represent joins as arrays, so if I want to get all the Employees from the Company object, I just do:

employee_array = myCompany.employees

and out pops all the records.

It's easy to understand in the base case. Anything with any real complexity to it is doomed to failure, and then you have to start monkeying around with SQL in your mapper anyway.

I won't start a project with a pre-existing database with ORM, it's too squirrely to get the mapping right. However, if I need some persistence for my app easily, ORM provides a good fit.