3 ms·
My current JSON-based system doesn't implement full SQL semantics. We definitely don't have (or actually need) GROUP BY. Doing full SQL would require ASTs, a qu
by frognumber 3y ago
My current JSON-based system doesn't implement full SQL semantics. We definitely don't have (or actually need) GROUP BY. Doing full SQL would require ASTs, a query optimizer, and similar. Right now, it's SQL-like, but the implementation is really quite dumb.
What I actually want is the whole dotty / efilter system, only with things like documentation.
We really do care about performance, though. From your code, this would not work:
api.apply("SELECT name FROM users WHERE age > 10",
vars={"users": ({"age": 10, "name": "Bob"},
{"age": 20, "name": "Alice"},
{"age": 30, "name": "Eve"}))
It would really need to be:
query = api.compile("SELECT name FROM users WHERE age > 10")
query(vars={"users": ({"age": 10, "name": "Bob"},
{"age": 20, "name": "Alice"},
{"age": 30, "name": "Eve"})))
Or more likely, vars would be a closure which would allow it to interact with the proper data stores.
As a footnote, that looks like a really nice project. I wish it were supported, maintained, and finished.