Why not add that functionality directly to SQLite via stored procs*
https://www.amazon.com/Hierarchies-Smarties-Kaufmann-Managem...
https://www.amazon.com/Hierarchies-Smarties-Kaufmann-Managem...
I'm considering doing a js template string implementation for node.. cql`...` type thing with an internal compilation cache.