Interesting project https://github.com/facebookincubator/CG-SQL
Hello ! Today I found this interesting project https://github.com/facebookincubator/CG-SQL that is a kind of DSL for stored procedures for sqlite. Cheers !
... a kind of DSL for stored procedures for sqlite.
To save the next person some searching, as the intro page doesn't properly hyperlink link to its documentation, the "most interesting bit" is:
Management summary: it implements what appears to be a fairly sophisticated DSL for SQL procedures. The DSL gets compiled to C and linked in to the application as a routine which can be called from C, as opposed to an SQL-bound UDF (which it's not, though wrapping such a call in a UDF looks like it would be trivial).
Thanks. Unfortunately (for some at least), and as usual for Facebook,
the generator appears to be Unix-only. We can hope the generated
code is not similarly Unix-only, but my expectations aren't high.
Perhaps portability will appear later, for once.
This does look very interesting though. Thanks for sharing.
What makes you say it's unix-only? Considering the tool is effectively reading some text files and spitting out other text files I was stunned by the notion of it being bound to a particular OS and wanted to know what atrocities the code must be committing, but lo and behold it builds and runs on windows.
I mean it definitely wasn't the smoothest build I've ever experienced, with the main pain point being finding compatible versions of bison/flex that run on windows (I only tried one version before giving up and running those build steps using bison/flex from WSL). But I've had worse build experiences just trying to tell cmake where I built a custom version of a dependent library XD
Perhaps you're on Cygwin? Is linking with PThreads Windows friendly?
Seems the cql build itself doesn't require pthreads. -lpthreads is mentioned in the Makefile but only used for the test targets.
That said I'm using gcc from MinGW-W64 and a basic pthreads test does work. It provides a small libwinpthread-1.dll (~51K) but that's the only dependency of the resulting executable.