11 ms·
What I want from a query language is for it to not be a language, but some kind of specification of components that can then be transmitted to the engine in a m
by BrenBarn 21d ago
What I want from a query language is for it to not be a language, but some kind of specification of components that can then be transmitted to the engine in a machine-readable way. The bizarre thing about SQL is that it has to be written in SQL. What if instead a JSON representation of the query (something akin to the AST, with a bit of processing done to boil it down) is what the engine took in? Then each language could specify the query in whatever syntax is most idiomatic for that language. Right now we do this with ORMs, but it's a huge pain because the ORMs are like a transpiler with a really free-form and messy language as the target. All the ORMs are just pasting strings together. If the "native" query format were more structured, we could have a lot more cool approaches for wrapping that on the programmer-facing side.