EvgSkv / logica

Logica is a logic programming language that compiles to SQL. It runs on DuckDB, Google BigQuery, PostgreSQL and SQLite.
https://logica.dev
Apache License 2.0
1.74k stars 91 forks source link

Function to just export the SQL #308

Open jon-whit opened 6 months ago

jon-whit commented 6 months ago

Instead of running the predicate of a program against a storage engine such as SQLite, I'd like to just output the raw SQL query. It would be nice if I could do so with user_flags as well, because I'd like to pass in values for predicates defined in the rule body.

Is this something you'd be willing to expose in the libraries API?

EvgSkv commented 6 months ago

Yes, this functionality is available. Here is an example: https://colab.research.google.com/drive/1ivq4Bjm8tjM7hm7XRHH6uXHacI5wLgQQ?usp=sharing

Please let me know if you hit any issues, or have any further questions.