Skip to content

Commit

Permalink
Bump sqlparser from 0.18.0 to 0.19.0 (#882)
Browse files Browse the repository at this point in the history
* Bump sqlparser from 0.18.0 to 0.19.0

Bumps [sqlparser](https://github.com/sqlparser-rs/sqlparser-rs) from 0.18.0 to 0.19.0.
- [Release notes](https://github.com/sqlparser-rs/sqlparser-rs/releases)
- [Changelog](https://github.com/sqlparser-rs/sqlparser-rs/blob/main/CHANGELOG.md)
- [Commits](apache/datafusion-sqlparser-rs@v0.18.0...v0.19.0)

---
updated-dependencies:
- dependency-name: sqlparser
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <[email protected]>

* .

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Maximilian Roos <[email protected]>
Co-authored-by: Maximilian Roos <[email protected]>
  • Loading branch information
3 people authored Jul 29, 2022
1 parent 7c2014c commit 5b4cbd6
Show file tree
Hide file tree
Showing 5 changed files with 11 additions and 8 deletions.
4 changes: 2 additions & 2 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,6 @@ input_file: book/tests/prql/language-features/dates_and_times-3.prql
---
SELECT
projects.*,
start + INTERVAL '10' DAY AS first_check_in
start + INTERVAL 10 DAY AS first_check_in
FROM
projects
2 changes: 1 addition & 1 deletion prql-compiler/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ version = "3.2.3"

[dependencies.sqlparser]
features = ["serde"]
version = "0.18.0"
version = "0.19.0"

[dependencies.serde]
features = ["derive"]
Expand Down
2 changes: 1 addition & 1 deletion prql-compiler/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -339,7 +339,7 @@ select `first name`
assert_display_snapshot!((compile(query)?), @r###"
SELECT
projects.*,
start + INTERVAL '10' DAY AS first_check_in
start + INTERVAL 10 DAY AS first_check_in
FROM
projects
"###);
Expand Down
9 changes: 6 additions & 3 deletions prql-compiler/src/sql/translator.rs
Original file line number Diff line number Diff line change
Expand Up @@ -229,7 +229,7 @@ fn sql_query_of_atomic_table(
let distinct = transforms.iter().any(|t| matches!(t, Transform::Unique));

Ok(sql_ast::Query {
body: SetExpr::Select(Box::new(Select {
body: Box::new(SetExpr::Select(Box::new(Select {
distinct,
top: if dialect.use_top() {
limit.map(|l| top_of_i64(l, dialect))
Expand All @@ -249,7 +249,7 @@ fn sql_query_of_atomic_table(
sort_by: vec![],
having,
qualify: None,
})),
}))),
order_by,
with: None,
limit: if dialect.use_top() {
Expand Down Expand Up @@ -584,7 +584,10 @@ fn translate_item(item: Item, dialect: &dyn DialectHandler) -> Result<Expr> {
_ => bail!("Unsupported interval unit: {}", interval.unit),
};
Expr::Value(Value::Interval {
value: interval.n.to_string(),
value: Box::new(translate_item(
Item::Literal(Literal::Integer(interval.n)),
dialect,
)?),
leading_field: Some(sql_parser_datetime),
leading_precision: None,
last_field: None,
Expand Down

0 comments on commit 5b4cbd6

Please sign in to comment.