News for hackers. Stuff that matters.
Re:Relational databases aren’t dinosaurs, they’re sharks by mrweasel on Saturday October 09, 2021 @05:19AM (#28808261)
Or you rewrite you queries so that you can use prepared statements. You’re right that we should avoid gluing strings together, but in most cases we can use prepared statements.

There’s also a middleground where developers learn to use the ORM better. I’ve seem people get terrible performance using the Django ORM, but after a rewrite, redesigning the queries and using the more advanced features performance would improve massively. The problem is that need to be able to write the SQL and then mentally backport to the ORMs syntax.

We’ve had customers complain about poor database performance. When we find the horrible queries generated by their ORM it’s frequently easier for the developer to just request more hardware or ask if we can: “performance tune” the database.

Re:Relational databases aren’t dinosaurs, they’re sharks by cageface on Saturday October 09, 2021 @06:37AM (#28808620)
Prepared statements are a good tool to have in your arsenal but for the majority of the queries you need an ORM will be fine. It doesn't absolve you of the need to understand SQL but it does save a huge amount of time and generally results in easier to follow code.
Re:Relational databases aren’t dinosaurs, they’re sharks by nicoburns on Saturday October 09, 2021 @07:23AM (#28808881)
We’ve had the opposite experience. We had a mix of irk code and raw SQL, and we’ve found that the SQL is much more readable. New code is all being written in SQL. Exception is insert and upsert queries which only ever write to one table and involve a lot of boilerplate.