Live data from Hacker News

PRQL: Pipelined Relational Query Language

github.com

1–10 of 214 posts

Re: PRQL: Pipelined Relational Query Language

#3
I really want this to take off and become a first party supported language for Postgres. Yes, yes, relational algebra is beautiful and all that jazz. SQL is a garbage, first pass design that should have been replaced decades ago. Even Codd has complaints about it. It is amazing what he invented, but we have learned a lot about PL design since then.

Re: PRQL: Pipelined Relational Query Language

#4
Previous Show HN: https://news.ycombinator.com/item?id=31897430

Show HN: PRQL 0.2 – a better SQL - 378 points by maximilianroos on June 27, 2022, 161 comments

Original post when it was conceived: https://news.ycombinator.com/item?id=30060784

PRQL – A proposal for a better SQL - 650 points by maximilianroos on Jan 24, 2022, 295 comments

Re: PRQL: Pipelined Relational Query Language

#6
For me the examples on the website https://prql-lang.org/ are the biggest selling point for PRQL, in particular the SQL it generates. It looks clean, straightforward, something I would've written myself.

In general, I like this slightly more careful take on modern database development. 10-15 years people would start a brand new database like Mongo, or Riak, or Influx, or whatever, and would try to convince application developers to select it for new projects. But recently we started getting more conservative options like EdgeDB, TimescaleDB, or even PRQL which all expect us to run Postgres with some addons and / or query preprocessors. Tech like this is so much easier to adopt!

I'm really liking what Edge folks are doing with schemas and migrations, but I do find PRQL syntax much more intuitive. My application code is littered with data transformation pipelines already: all these map / filter chains in TYpeScript, iterators in Rust, enumerables in Ruby, streams in Java, LINQ in .net, Rx in dozens of languages etc. etc. So the concept is very, very familiar. Getting nice SQL queries out of PRQL that I can store, inspect later, see the query plans, add indices where necessary, is just great. It's such a good tool!

Re: PRQL: Pipelined Relational Query Language

#9

How are joins handled? A relational db is largely about the relations, otherwise this is more of a document query language.

I had the same question. From the docs, it looks pretty elegant:

    from employees
    join side:left positions (employees.id==positions.employee_id)
which translates to

    SELECT
      employees.*,
      positions.*
    FROM
      employees
      LEFT JOIN positions ON employees.id = positions.employee_id

Re: PRQL: Pipelined Relational Query Language

#10

I really want this to take off and become a first party supported language for Postgres. Yes, yes, relational algebra is beautiful and all that jazz. SQL is a garbage, first pass design that should have been replaced decades ago. Even Codd has complaints about it. It is amazing what he invented, but we have learned a lot about PL design since then.

Relational algebra is still great, it is the sql that made an unbelievable mess out of this beautiful idea.
Post reply on HN