Pro2sql – a lighweight prolog to SQL translator - Reply 1

This is quite interesting! I’ve recently integrated SWI-Prolog as an extension for Postgres (see my PR to the Omnigres repo). It has a rudimentary query/3 primitive, and while it has some nice features like unifying columns by name and/or index, I keep thinking about additional SQL building facilities there.

Your work is certainly inspiring, and it’d be great to see if it can be integrated with mine (or if I can learn something from it).

Looking at predicates like table_def, my extension can provide this to Prolog functions on demand.

1 Like

Thanks, Yurii.

I’m glad you find pro2sql of interest. I had a quick look at the SWI-Prolog integration to Omnigress, but I couldn’t see examples of how it might work, so I’m not entirely sure where prolog fits into the picture. This is probably compounded by my unfamiliarity with Postgresql.

However, I’d be happy to answer questions about pro2sql if you want to take further steps to integrate it.

cheers,

RdR

It basically serves as a language in which Postgres users would be able to implement their functions (aka user-defined-functions), see some examples in the test suite: omnigres/extensions/omni_prolog/tests/query.yml at 3b51e0a9ae50da4facc56f92b7056481cc7e53b9 · omnigres/omnigres · GitHub

I will certainly let you know if I will have any questions and thanks again for sharing your work!