Crate qrlew

Crate qrlew 

Source
Expand description

§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.

Re-exports§

pub use builder::Ready;
pub use builder::With;
pub use builder::WithContext;
pub use builder::WithIterator;
pub use builder::WithoutContext;
pub use data_type::value::Value;
pub use data_type::DataType;
pub use expr::Expr;
pub use relation::Relation;
pub use types::And;
pub use types::Factor;
pub use types::Or;
pub use types::Term;

Modules§

ast
Expose sqlparser::ast as part of qrlew SQL Abstract Syntax Tree (AST) types
builder
Builder utilities
data_type
The data types used in Qrlew
debug
Debugging utilities
dialect
Expose sqlparser::ast as part of qrlew
dialect_translation
Tools for queries from one dialect into another A specific Dialect is a struct holding: - a method to provide a sqlparser::Dialect for the parsing - methods varying from dialect to dialect regarding the conversion from AST to Expr+Relation and vice-versa
differential_privacy
Methods to transform Relations into differentially private ones
display
Methods to display representations of Relations and Exprs
encoder
Encoding utilities
expr
Expr definition and manipulation
hierarchy
Hierarchy structure
io
Utilities to run tests on real data
namer
Naming utilities
parser
Expose sqlparser::ast as part of qrlew SQL Parser
privacy_unit_tracking
Methods to define Relations’ Privacy Unit and propagate it
relation
Relation definition and manipulation
rewriting
sampling_adjustment
Given a Relation representing a computaion on a sampled table, a table (representing the schema of original dataset) and a weight representing
setup
sql
SQL parsing and conversion into Relation
synthetic_data
tokenizer
Expose sqlparser::ast as part of qrlew SQL Tokenizer
types
Type utilities
visitor
Some utilities to ease the implementation of Visitor / Acceptor in rust