level-sql icon indicating copy to clipboard operation
level-sql copied to clipboard

Calypso: Related work that might be useful.

Open kevinswiber opened this issue 10 years ago • 5 comments

Howdy.

This repo just popped up on my radar.

I'm doing something similar with kevinswiber/calypso.

You can find all the query language parsing code here: https://github.com/kevinswiber/calypso/tree/master/compiling

I'm using Jison to generate a SQL parser. It doesn't fully conform to any SQL standard, but it's a start.

The goal of Calypso is to provide a common query language that can be implemented on top of any queryable data source. I have drivers for MongoDB and a Backend-as-a-Service called Usergrid. Calypso was born out of another project. I still need to port over older CouchDB and Salesforce drivers.

It also has a data mapper associated with it for automatically hydrating query results into object models.

The source code is released under the MIT license (my employer, Apigee, holds the copyright).

Here's a usage example: https://gist.github.com/kevinswiber/44542186e5dbc5bd03c6

Anyway, the point is... there might be some code you can steal from Calypso to serve your interests. If so, have at it!

Cheers!

kevinswiber avatar Oct 31 '13 18:10 kevinswiber

Very cool man! This is great work and I'm sure that it will be a valuable code read. I'd love to discuss more, and it seems like you have lots of domain knowledge! hey, if you use IRC you should hop into #stackvm and ##leveldb on freenode for mad science party. :)

heapwolf avatar Oct 31 '13 18:10 heapwolf

So... as the world turns, and it's now 9 months later...

I wrote a persistent key-value store for Node early last year, https://github.com/argo/medea. I now have a project that needs it. Also, @kesla has created an implementation of AbstractLevelDOWN for Medea, https://github.com/kesla/medeadown.

My project is going to need SQL queries. As linked above, I happen to know a thing or two about parsing SQL. While I was going to create a SQL implementation that only works with Medea, it seems a shame to not extend that to the wider LevelUP community.

Have you seen enough interest in this project that the Node/LevelDB community would benefit? Otherwise, I may just couple to Medea functionality rather than going through the AbstractLevelDOWN interface.

Cheers.

kevinswiber avatar Jul 22 '14 22:07 kevinswiber

The parsing/lexing is actually complete (to spec) what's missing is the mapping between the parsed-ast and level-*, which shouldn't be too hard if there are a few people working together on it ;)

On Tuesday, July 22, 2014, Kevin Swiber [email protected] wrote:

So... as the world turns, and it's now 9 months later...

I wrote a persistent key-value store for Node early last year, https://github.com/argo/medea. I now have a project that needs it. Also, @kesla https://github.com/kesla has created an implementation of AbstractLevelDOWN for Medea, https://github.com/kesla/medeadown.

My project is going to need SQL queries. As linked above, I happen to know a thing or two about parsing SQL. While I was going to create a SQL implementation that only works with Medea, it seems a shame to not extend that to the wider LevelUP community.

Have you seen enough interest in this project that the Node/LevelDB community would benefit? Otherwise, I may just couple to Medea functionality rather than going through the AbstractLevelDOWN interface.

Cheers.

— Reply to this email directly or view it on GitHub https://github.com/hij1nx/level-sql/issues/2#issuecomment-49809710.

Paolo Fragomeni Founder, Here is How http://hereishow.to

github.com/hij1nx twitter.com/hij1nx

heapwolf avatar Jul 22 '14 22:07 heapwolf

I actually don't need SQL ANSI/ISO specification conformity. I'm using Calypso Query Language (https://github.com/kevinswiber/caql), which will likely merge in some features of N1QL (https://github.com/couchbaselabs/tuqtng/blob/master/docs/n1ql-v1.md) down the road.

I worked on getting it wired up to Medea today, and that appears to be working well (so far).

I think I can make this code modular enough so that it's trivial to implement LevelDOWN compatibility, so I may end up doing both. Thanks for your thoughts!

kevinswiber avatar Jul 24 '14 18:07 kevinswiber

Just to follow up...

I've got some initial support for CaQL and LevelUP. Not being super-familiar with LevelUP, I'm certain there is room for improvement.

level-caql: https://github.com/kevinswiber/level-caql

medea-caql: https://github.com/kevinswiber/medea-caql

caql-js-compiler: https://github.com/kevinswiber/caql-js-compiler

Cheers.

kevinswiber avatar Jul 24 '14 21:07 kevinswiber