Pipelined Relational Query Language, pronounced "Prequel".
PRQL is a modern language for transforming data — a simpler and more powerful SQL. Like SQL, it's readable, explicit and declarative. Unlike SQL, it forms a logical pipeline of transformations, and supports abstractions such as variables and functions. It can be used with any database that uses SQL, since it transpiles to SQL.
from employees # Each line transforms the previous result. filter start_date > @2021-01-01 # Clear date syntax. derive [ # `derive` adds columns / variables. gross_salary = salary + payroll_tax, gross_cost = gross_salary + benefits_cost # Variables can use other variables. ] filter gross_cost > 0 group [title, country] ( # `group` runs a pipeline over each group. aggregate [ # `aggregate` reduces each group to a row. average salary, sum salary, average gross_salary, sum gross_salary, average gross_cost, sum_gross_cost = sum gross_cost, # `=` sets a column name. ct = count, ] ) sort [sum_gross_cost, -country] # `-country` means descending order. filter ct > 200 take 20
To learn more, check out the PRQL Website.
For specific resources, check out:
- PRQL Playground — experiment with PRQL in the browser.
- PRQL Book — the language documentation.
- Contributing — join us in building PRQL, through writing code or inspiring others to use it.
- PyPRQL Docs — the PyPRQL documentation, the python bindings to PRQL, including Jupyter magic.
- dbt-prql — write PRQL in dbt models.
- PRQL VSCode Extension
Many thanks to those who've made our progress possible:
We have a few core developers who are responsible for reviewing code, making decisions on the direction of the language, and project administration:
We welcome others to join who have a track record of contributions.