4 ms·
Data that's not a good fit to be represented as relations is a completely different issue, and I agree with you on that. Simple queries maybe simple to write,
by brazzy 14y ago
Data that's not a good fit to be represented as relations is a completely different issue, and I agree with you on that.
Simple queries maybe simple to write, but they're still boilerplate you're better off without. An ORM lets you work at a higher level of abstraction.
> A lot of the nitty gritty of writing relational queries by hand (as noted, escaping, listing the fields to be queried etc) can be abstracted by a set of helper functions, and maintaining these is much simpler than fixing problems with the relational mapping.
Except that you just started to roll your own ORM, and I can guarantee that maintaining it will not stay simple for very long.
> If your join is directly expressed in SQL, you solve the problem by modifying the join.
Yep, that's what you do with a good ORM.
>There's no additional headache involving figuring out how the object model turns into tables and queries.
Wrong - as long as you have a relational DB at one end and an object model at the other, this additional headache is unavoidable.