Live data from Hacker News

PRQL: Pipelined Relational Query Language

github.com

31–40 of 214 posts

Re: PRQL: Pipelined Relational Query Language

#31
Forwarding this to some of my team members right now.

We use SQL for a lot of things, almost all of them implementation of customized business rules. When attempting to develop a business rule that needs to manifest as a single SQL query, your brain is forced to work in a very particular crystalline way. Many business rules are defined in procedural terms at requirements time, so having a way to implement them in the same could be beneficial.

Re: PRQL: Pipelined Relational Query Language

#32
post #12

Earlier quoted context omitted.

I like it too. You can also alias them easily from e=employees join p=positions (e.id==p.employee_id)

positions p is a SQL alias. Was that too difficult?

It's less about it being difficult, and more about it being easy, obvious to read/write, and consistent within the new design. Was that not obvious?

Re: PRQL: Pipelined Relational Query Language

#33
post #14

If the main complaint people have about SQL is that you can't swap SELECT, FROM and WHERE, then that's pretty good for a language designed in the 70s. This, by contrast, looks like it has a bunch of random line noise for syntax. Why on earth should I like this: `join side:left p=positions (p.id==employees.employee_id)` better than this: `LEFT JOIN positions AS p ON p.id = employees.employee_id` ?

Maybe it's my familiarity with R and the tidyverse paradigm, but I think in general this paradigm and syntax is pretty readable. The example you chose is perhaps a case where brackets and commas go a long way, but that aside it's really not too bad in context of the rest of the language. `:` seems to consistently be treated as keyword arguments, and `=` for aliasing.

Re: PRQL: Pipelined Relational Query Language

#34
post #16

Earlier quoted context omitted.

I don't get that - to me the examples are much less readable than SQL and I don't understand why I should want to use this. Like, yes, you can reorder the query sections, which seems to be everyone's complaint about SQL, but then you also have multiple types of brackets, colons and other syntax for no reason, all while not really accomplishing anything SQL doesn't already do. What's the attraction?

it seems like any SQL parser could let you put FROM first and solve a lot of the annoyances of SQL

The stiff syntax is a feature. The infamous 1000 line sales report query is already a bear to maintain. If you get a clever developer reordering syntax it will only be worse.

Re: PRQL: Pipelined Relational Query Language

#35

This must not be missing here then: "I don't want to learn your garbage query language" [1] [1] https://erikbern.com/2018/08/30/i-dont-want-to-learn-your-ga...

Big fan of this post! We link to it from PRQL website.

Our goal for PRQL is a great language to integrate with & build on. So we don't have N languages for N databases. Because PRQL will always be open-source, and won't ever have a commercial product, we think that's much more feasible than a DB-specific or product-specific language.

(PRQL dev here)

Re: PRQL: Pipelined Relational Query Language

#38

Just a heads up that Prefect integration link on the landing page doesn't work - 404. This is the one I was interested in!

Thanks! We just did a big refactoring so we do have some links failing in our tests. Just PR-ed a fix to this one: https://github.com/PRQL/prql/pull/3075

(PRQL dev here)

Re: PRQL: Pipelined Relational Query Language

#39

>declarative An admirable ideal, but declarative languages always seem to devolve towards some frankenstein imperative/declarative hybrid. We need to stop going down this path and embrace Pulumi's pattern: use existing general purpose imperative languages to generate a declarative structure. Instead, people try to take their not-mature declarative language and fit a weird general purpose language inside it. EDIT>> I'…

I've silently been a big fan of this approach for years but hadn't heard about it anywhere (most likely because I'm not familiar with Pulumi).

Could you provide a reference that elaborates on "Pulumi's pattern"?

Re: PRQL: Pipelined Relational Query Language

#40

Just a heads up that Prefect integration link on the landing page doesn't work - 404. This is the one I was interested in!

Sorry that that was your first experience. I have opened an issue for this for you: https://github.com/PRQL/prql/issues/3074

The correct link is the following: https://prql-lang.org/book/project/integrations/prefect.html

TBH, that one is not much of an integration yet. It essentially boils down do.

    $ pip install prql-python
and then

    import prql_python
    PostgresExecute.run(..., query=prql_python.compile(prql))
I don't personally work with Prefect, so if you have any ideas about what you would like to see here, please comment on the issue or on Discord. We're also very open to Pull Requests and they usually get merged fast ;-)

Disclaimer: I'm a PRQL contributor.

Post reply on HN