2 ms·
Hmm, I don’t think so. If you have a dozen similar queries, then you can factor out the similarity (say, into a view, or a Ruby subroutine that generates the S
by kragen 12y ago
Hmm, I don’t think so. If you have a dozen similar queries, then you can factor out the similarity (say, into a view, or a Ruby subroutine that generates the SQL). If you have a thousand that vary in a lot of different ways, a few subroutines isn’t enough; you need a DSL to factor out the similarity, aka “automate away” the queries.
But then you need someone to write down the idiosyncratic bits of each query, the thing that makes it different from the other thousand, in your DSL. For a lot of systems, the right DSL is in fact SQL itself, but even if it’s not, you still need people to write in it.
In short, nonprogrammers writing cobbled-together SQL queries are the result of automating away the non-idiosyncratic aspects of the queries.