2 ms·
The Datalog query language is a subset of Prolog. I wonder how hard it would be to translate Datalog into SQL and query PostgreSQL with that. XTDB (aka Crux), w
by hirundo 5y ago
The Datalog query language is a subset of Prolog. I wonder how hard it would be to translate Datalog into SQL and query PostgreSQL with that. XTDB (aka Crux), which uses Datalog, supports some limited SQL querying. How limited would it be to go in the other direction?
- dgb23 5y agoIf you’re ok with typecasting then it’s relatively straight forward. I think postgres has some convenient utility around that.
- maweki 5y agoWith recursive common table expressions it is really straightforward. You just have to manually stratify your datalog program to find out the order for the CTE. And then you just write down all the rules. edit: As long as queries aren't recursive in a difficult manner, like co-recursive or have multiple recursive calls in the same rule.