level-sql
level-sql copied to clipboard
fuck it.
@hij1nx In my proof-of-concept of writing a MySQL driver that had the back-end implemented in levelup, called sql-engine. I used the simpleSqlParser to parse the SQL syntax, and then I transformed it to mongodb style query suitable for jsonquery.
Ah, that looks cool. What are your thats on making sorts fast? Its a pretty old problem, but endlessly interesting.
Yeah, sorts are tricky. In my proof-of-concept I didn't get to implementing the order by field stuff, sorry! And trying to do sorting in a streaming kind of way is hard too. Even with SQL databases, doing an order by delays the first result considerably versus not ordering the data.
I think there are some sorted-stream type modules out there that I was looking at using to implement this, the more I think of it. Though most of those just do an Array.sort() and then stream the values if I recall...