Skip to content

Commit

Permalink
merge with main
Browse files Browse the repository at this point in the history
  • Loading branch information
victoria de sainte agathe committed Nov 20, 2023
2 parents 8c4bb01 + 71db569 commit 95b637c
Show file tree
Hide file tree
Showing 27 changed files with 910 additions and 1,498 deletions.
13 changes: 12 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,22 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
## [Unreleased]
## Added
- `CAST` function [MR188](https://github.com/Qrlew/qrlew/pull/188)
- `SUBSTR` function [MR186](https://github.com/Qrlew/qrlew/pull/186)

## [0.5.1] - 2023-11-19
## Added
- Added `Count(*)` by parsing it as `Count(1)`

### Changed
- Add a warning when the textbook gaussian mechanism is not really applied [#190](https://github.com/Qrlew/qrlew/issues/190)

## [0.5.0] - 2023-11-19
### Changed
- Breaking name change: Protected Entity -> Privacy Unit + PEP -> PUP [#189](https://github.com/Qrlew/qrlew/issues/189)

## [0.4.13] - 2023-11-14
## Added
- `TRIM` function [MR183](https://github.com/Qrlew/qrlew/pull/183)
- `SUBSTR` function [MR186](https://github.com/Qrlew/qrlew/pull/186)

## [0.4.12] - 2023-11-09
### Fixed
Expand Down
4 changes: 2 additions & 2 deletions Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
[package]
authors = ["Nicolas Grislain <ng@sarus.tech>"]
name = "qrlew"
version = "0.4.13"
version = "0.5.0"
edition = "2021"
description = "Sarus Qrlew Engine"
documentation = "https://docs.rs/qrlew"
Expand All @@ -19,7 +19,7 @@ rand = "0.8"
log = "0.4"
env_logger = "0.10"
colored = "2.0"
itertools = "0.11"
itertools = "0.12"
paste = "1.0.7"
serde = { version = "1.0", features = ["derive", "rc"] }
serde_json = "1.0"
Expand Down
3 changes: 3 additions & 0 deletions examples/ast.rs
Original file line number Diff line number Diff line change
Expand Up @@ -129,5 +129,8 @@ fn main() -> Result<(), &'static str> {
// Print an AST with Values
print_ast("(VALUES (1), (2), (3)) AS t1")?;

// Print an AST with count(*)
print_ast("SELECT COUNT(*) FROM table_1")?;

Ok(())
}
96 changes: 0 additions & 96 deletions examples/website.rs
Original file line number Diff line number Diff line change
Expand Up @@ -43,103 +43,7 @@ fn ranges() {
println!("query = {query}");
}

// fn protect() {
// use qrlew::ast::Query;
// use qrlew::display::Dot;
// use qrlew::io::{postgresql, Database};
// use qrlew::With;
// use qrlew::{sql::parse, Relation};

// let database = postgresql::test_database();
// let relations = database.relations();
// let relation = Relation::try_from(
// parse(
// "SELECT * FROM order_table JOIN
// item_table ON id=order_id;",
// )
// .unwrap()
// .with(&relations),
// )
// .unwrap();
// println!("relation = {relation}");
// let relation: Relation = relation
// .force_protect_from_field_paths(
// &relations,
// vec![
// (
// "item_table",
// vec![
// ("order_id", "order_table", "id"),
// ("user_id", "user_table", "id"),
// ],
// "name",
// ),
// ("order_table", vec![("user_id", "user_table", "id")], "name"),
// ("user_table", vec![], "name"),
// ],
// )
// .into();
// println!("relation = {relation}");
// relation.display_dot().unwrap();
// let query = Query::from(&relation);
// println!("query = {query}");
// }

// fn compile() {
// use qrlew::ast::Query;
// use qrlew::display::Dot;
// use qrlew::io::{postgresql, Database};
// use qrlew::With;
// use qrlew::{sql::parse, Relation};

// let database = postgresql::test_database();
// let relations = database.relations();
// let relation = Relation::try_from(
// parse("SELECT sum(price) FROM item_table;")
// .unwrap()
// .with(&relations),
// )
// .unwrap();
// println!("relation = {relation}");
// let pep_relation = relation.force_protect_from_field_paths(
// &relations,
// vec![
// (
// "item_table",
// vec![
// ("order_id", "order_table", "id"),
// ("user_id", "user_table", "id"),
// ],
// "name",
// ),
// ("order_table", vec![("user_id", "user_table", "id")], "name"),
// ("user_table", vec![], "name"),
// ],
// );
// pep_relation.display_dot().unwrap();

// let epsilon = 1.;
// let delta = 1e-3;
// let epsilon_tau_thresholding = 1.;
// let delta_tau_thresholding = 1e-3;
// let (relation, _) = pep_relation
// .dp_compile(
// epsilon,
// delta,
// epsilon_tau_thresholding,
// delta_tau_thresholding,
// )
// .unwrap()
// .into();
// relation.display_dot().unwrap();
// println!("relation = {relation}");
// let query = Query::from(&relation);
// println!("query = {query}");
// }

fn main() {
// rewrite();
ranges();
// protect();
// compile();
}
Loading

0 comments on commit 95b637c

Please sign in to comment.