obi1kenobi / trustfall

A query engine for any combination of data sources. Query your files and APIs as if they were databases!
Apache License 2.0
2.38k stars 69 forks source link

Decoupling the query language from the query engine? #132

Open snth opened 1 year ago

snth commented 1 year ago

Hi,

I watched your HYTRADBOI 2022 talk and this looks super cool!

I'm wondering how closely linked the query language is to the query engine itself?

To me it seems like the real magic is your query engine and I would love to see that exposed through other query languages. In particular I'm a contributor to PRQL and would love to be able to run PRQL queries on your query engine. PRQL currently only supports SQL as a backend and plans to go beyond that are quite some way off atm but it's interesting to think about.

Where would you see the limitations of providing a SQL frontend (and hence also PRQL) to trustfall?

obi1kenobi commented 1 year ago

Hi,

Thanks for watching the talk and for looking into Trustfall!

My stance on other frontends for the Trustfall engine is "YES PLEASE" 😁 My ultimate goal for Trustfall is to make it the LLVM of data: LLVM intermediates between programming languages and hardware, and Trustfall should intermediate between data use and data providers regardless of format, access pattern, storage mechanism, etc.

In light of the above, the language and engine today are somewhat tied together, but not particularly strongly so. I've been following the work on PRQL and I'd be interested in exploring what a PRQL/SQL frontend might look like. I suspect I won't have time to write code for it myself (I'm instead working on something that produces a literal 1000x speedup), but I'd be happy to support you or someone else taking point on it.

The key points I think would be worth keeping an eye on are:

If hopping on a quick video call and walking through Trustfall queries or source code or anything else would be helpful as you decide how to move forward, I'd be happy to do that!

obi1kenobi commented 1 year ago

Just following up — would you be interested in collaborating on a PRQL frontend for Trustfall? I've been too swamped with other work to properly look into it, but if you're open to working together on it, I'd be happy to join in!