2 ms·
> Imports happen in wildly different ways, temp tables, choices of inserts vs. updates is a per-platform choice in some cases. All of these bits of SQL, though
by mumblemumble 6y ago
> Imports happen in wildly different ways, temp tables, choices of inserts vs. updates is a per-platform choice in some cases.
All of these bits of SQL, though, are things that ORMs typically handle by simply not using them. If you're limiting yourself to the subset of SQL that you can access with a DSL, it's pretty standard.
I agree that ORMs help defend against SQL injection, but so does any linter worth its salt.
To me, the real advantage of these DSLs is that they can get you some compile-time guarantees that your queries have some minimum level of validity. Raw SQL needs to be explicitly tested, otherwise you don't even have a guarantee that it's syntactically valid. I'm personally on the fence about whether that outweighs the cost of having a custom DSL, but I'm biased - I tend to avoid ORMs, anyway, so that I can have nice things like common table expressions and temp tables and PIVOT.
But if you're using a standard DSL such as .NET's LINQ, which everyone working on the platform already needs to know, anyway, then I can definitely see the attraction. That also eliminates a lot of the core complaint in TFA.