Re:What ORMs have taught me: just learn SQL
by krapp on Monday August 04, 2014 @05:07PM
(#8134027)
I have a laravel project for which all of my models are raw SQL statements for this reason. At the very least, it makes the code more portable, and it makes it easier to reason about the statements when you can actually see them.
[ Parent
| on HN ]
It makes your code less portable. Raw SQL means you're essentially tied to a single DB provider. What happens when you need to move to a different one?
Then you should probably rewrite your statements anyways to take advantage of platform-specific features. I won't write a query on MySQL the same as I would on Postgres, because there's usually a better way.
CRUD is about all that can honestly stay the same, as IMO that's where ORMs shine.
Sorry... I meant more portable between applications (assuming you're willing to stick with SQL), obviously not between database providers.
Re:What ORMs have taught me: just learn SQL
by JimBarrows on Monday August 04, 2014 @06:27PM
(#8134417)
What if you don't need to move to a different one?
> At the very least, it makes the code more portable
How writing SQL make your code more portable ? using an abstraction make something portable.SQL implementations are differents from one table to another.