38 releases (4 breaking)

new 0.5.5 Dec 8, 2023
0.5.2 Nov 20, 2023
0.2.1 Jul 27, 2023

#2 in #rewriting

Download history 22/week @ 2023-08-16 74/week @ 2023-08-23 27/week @ 2023-08-30 26/week @ 2023-09-06 70/week @ 2023-09-13 136/week @ 2023-09-20 260/week @ 2023-09-27 15/week @ 2023-10-04 12/week @ 2023-10-11 96/week @ 2023-10-18 234/week @ 2023-10-25 69/week @ 2023-11-01 133/week @ 2023-11-08 164/week @ 2023-11-15 86/week @ 2023-11-22 182/week @ 2023-11-29

590 downloads per month
Used in qrlew-sarus


38K SLoC

Qrlew framework (by Sarus)

Open source SQL manipulation framework written in Rust

What is Qrlew?

Qrlew is an open source library that aims to parse and compile SQL queries into an Intermediate Representation (IR) that is well-suited for various rewriting tasks. Although it was originally designed for privacy-focused applications, it can be utilized for a wide range of purposes.

SQL Query IR

Qrlew transforms a SQL query into a combination of simple operations such as Map, Reduce and Join that are applied to Tables. This representation simplifies the process of rewriting queries and reduces dependencies on the diverse range of syntactic constructs present in SQL.

Type Inference Engine

Differential Privacy (DP) guaranrtees are hard to obtain without destroying too much information. In many mechanisms having prior bounds on values can improve the utility of DP results dramatically. By propagating types cleverly, Qrlew can returns bounds for all values.

Differential Privacy compiler

Qrlew can compile SQL queries into Differentially Private ones. The process is inspired by Wilson et al. 2020. The complexity of the compilation process makes Qrlew IR very useful at delivering clean, readable and reliable code.


~626K SLoC