#sql #compiler #data-pipeline #data #pipeline #select #prql

bin+lib prql-compiler

PRQL is a modern language for transforming data — a simple, powerful, pipelined SQL replacement

14 releases

Uses new Rust 2021

new 0.3.1 Dec 4, 2022
0.3.0 Nov 30, 2022
0.2.11 Nov 20, 2022
0.2.5 Jul 29, 2022

#363 in Development tools

Download history 17/week @ 2022-08-13 23/week @ 2022-08-20 9/week @ 2022-08-27 21/week @ 2022-09-03 20/week @ 2022-09-10 28/week @ 2022-09-17 18/week @ 2022-09-24 24/week @ 2022-10-01 80/week @ 2022-10-08 70/week @ 2022-10-15 200/week @ 2022-10-22 41/week @ 2022-10-29 35/week @ 2022-11-05 23/week @ 2022-11-12 91/week @ 2022-11-19 73/week @ 2022-11-26

230 downloads per month
Used in 2 crates

Apache-2.0

605KB
11K SLoC

PRQL compiler

prql-compiler contains the implementation of PRQL's compiler, written in rust.

For more on PRQL, check out the PRQL website or the PRQL repo.

Installation

prql-compiler can be installed with cargo:

cargo install prql-compiler

...or built from source:

# from prql/prql-compiler
cargo install --path .

It can be installed via brew too:

brew install prql/prql/prql-compiler

Usage

$ echo "from employees | filter has_dog | select salary" | prql-compiler compile

SELECT
  *
FROM
  employees
WHERE
  has_dog

Internal jargon

Frame = Descriptor of a table. Contains list of columns (with names and types) and cardinality of rows. Does not contain data.

Table = Frame + data within that frame. Relation table-frame is analogous to object-class in Java.

Dependencies

~10–17MB
~327K SLoC