Hacker News new | ask | show | jobs
by joeatwork 807 days ago
An alternative query language for PostgreSQL would be a wonderful thing! But it isn’t clear that’s what this is.
3 comments

If you're interested in an alternative query language, https://prql-lang.org/ is a good one.
Thanks for the mention. For Postgres, the easiest way to use PRQL is the plprql extension:

Link: https://github.com/kaspermarstal/plprql

Previous discussion: https://news.ycombinator.com/item?id=39428609

> it isn't clear that's what this is

Because that's not what this is - this is for when you write e.g. `language plpgsql` in defining some function; instead of that (with this installed) you could write `language plprolog` and use prolog.

yes, I have plans to try adding some query helpers eventually.

One could imagine representing queries as compound terms, like: q(user(id=Id, name=like("Bob%"), email=Email))

which would query, from user table and bind Id and Email for all matches. I plan to experiment with something like that.