prql README

The project's README from github.com/PRQL/prql. As one markdown file: README.md.

PRQL

Website Playground Language Docs Discord Twitter

GitHub CI Status GitHub contributors Stars

Pipelined Relational Query Language, pronounced "Prequel".

PRQL is a modern language for transforming data — a simple, powerful, pipelined SQL replacement. 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 compiles to SQL.

PRQL can be as simple as:

from tracks
filter artist == "Bob Marley"                 # Each line transforms the previous result
aggregate {                                   # `aggregate` reduces each column to a value
  plays    = sum plays,
  longest  = max length,
  shortest = min length,                      # Trailing commas are allowed
}

Here's a larger example of the language:

from employees
filter start_date > @2021-01-01               # Clear date syntax
derive {                                      # `derive` adds columns / variables
  gross_salary = salary + (tax ?? 0),         # Terse coalesce
  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 value
    average gross_salary,
    sum_gross_cost = sum gross_cost,          # `=` sets a column name
  }
)
filter sum_gross_cost > 100_000               # `filter` replaces both of SQL's `WHERE` & `HAVING`
derive id = f"{title}_{country}"              # F-strings like Python
derive country_code = s"LEFT(country, 2)"     # S-strings allow using SQL as an escape hatch
sort {sum_gross_cost, -country}               # `-country` means descending order
take 1..20                                    # Range expressions (also valid here as `take 20`)

For more on the language, more examples & comparisons with SQL, visit prql-lang.org. To experiment with PRQL in the browser, check out PRQL Playground.

Current Status - July 2026

PRQL is ready to use by the intrepid, either with our supported integrations, or within your own tools, using one of our supported language bindings.

PRQL still has some bugs and some missing features, and is probably only ready to be rolled out to non-technical teams for fairly simple queries.

Development has slowed as we decide how to work on a new resolver, which will let us squash many bugs and simplify our code a lot. It'll also let us scale the language without scaling the complexity of the compiler.

While we figure that out, we're also thinking about:

And:

We're increasingly open to contributions for bigger rewrites of the resolver given how bottlenecked we are on it. If you're interested in contributing, please reach out in an issue or on Discord.

Get involved

To stay in touch with PRQL:

Explore

Repo organization

This repo is composed of:

It also contains our testing / CI infrastructure and development tools. Check out our development docs for more details.

Contributors

Many thanks to those who've made our progress possible:

Contributors

prql (PRQL/prql)

Searching Database…

10.9K ·GitHub
Что это такое?PRQL (произносится 'Prequel') — это современный язык для преобразования данных: простая, мощная замена SQL на основе конвейеров.
Чем это отличается от того, чтобы писать SQL вручную?Запросы остаются читаемыми, явными и декларативными, как в SQL, но каждый запрос выстраивается в логический конвейер преобразований и поддерживает абстракции вроде переменных и функций.
Чтобы попробовать, нужно что-то устанавливать?Для экспериментов — нет: есть браузерный Playground. Для реальной работы подключите поддерживаемую интеграцию, например расширение для VS Code, Jupyter или QStudio, либо привязку к языку вроде pyprql (Python) или prqlc-js (JavaScript).
Мне нужно менять базу данных или переходит на другие драйверы?Нет. PRQL компилируется в SQL, поэтому работает с любой базой данных, использующей SQL, — на стороне базы ничего менять не нужно.
Можно ли сегодня спокойно строить на этом продакшен-запросы?Пока это для смелых: ещё встречаются баги и нехватка функций, и для нетехнических команд он, скорее всего, готов только на довольно простых запросах. Разработка к тому же замедлилась, пока команда переделывает resolver компилятора.
Что именно превращает мой PRQL в SQL?Компилятор prqlc, написанный на Rust: он превращает PRQL в SQL и поставляется как CLI вместе с привязками для разных языков.
Язык вообще ещё развивается?Да, но сейчас медленно: работа идёт над новым resolver'ом компилятора, надёжностью уже поддерживаемых возможностей, закрытием пробелов почти до всех стандартных SQL-запросов, а также над экспериментальной поддержкой модулей и проектов из нескольких файлов.
Можно запускать PRQL в Jupyter-ноутбуках?Да — Jupyter-магия выполняет PRQL к базе данных или к Pandas DataFrame, файлу CSV или Parquet через DuckDB. Привязки для Python и документация находятся в пакете pyprql.
Как произносится PRQL?Это сокращение от Pipelined Relational Query Language, произносится 'Prequel'.
Где мне изучить язык и посмотреть побольше примеров?Документация по языку — это PRQL Book, а на prql-lang.org есть ещё примеры и сравнения с SQL.
What are similar projects?dbx, ducklake, polyledger, prefect, marimo, pkl, CalcKernel, coral
Creator
PRQL
Size
25.6 MB
Stars
10.9K
Age
4y
Commits · 90 Days