Skip to content
This repository has been archived by the owner on Nov 19, 2023. It is now read-only.

Commit

Permalink
Updates to prql-compiler 0.4.2 and fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
Tobias Brandt authored and Tobias Brandt committed Jan 31, 2023
1 parent 4f810ea commit 40102d0
Show file tree
Hide file tree
Showing 5 changed files with 9 additions and 7 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
## 0.0.15 - UNRELEASED

* Adds --version parameter (#29, @eitsupi)
* Updates prql-compiler to 0.4.2 (#27, @aljazerzen)

## 0.0.14 - 2022-11-09

Expand Down
6 changes: 3 additions & 3 deletions Cargo.lock

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

4 changes: 2 additions & 2 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ repository = "https://github.com/prql/prql-query"
license = "MIT OR Apache-2.0"
edition = "2021"
rust-version = "1.64.0"
version = "0.0.14"
version = "0.0.15"

[[bin]]
name = "pq"
Expand All @@ -29,7 +29,7 @@ env_logger = "0.9.0"
log = "0.4.17"
parquet = { version = "23", optional = true }
polars = { version = "0.24.2", optional = true, features = ["docs-selection"] }
prql-compiler = { version = "0.4.1" }
prql-compiler = { version = "0.4.2" }
regex = { version = "1.6.0", optional = true }
tokio = { version = "1.19", features = ["rt-multi-thread", "macros"] }
url = "2"
Expand Down
1 change: 1 addition & 0 deletions src/backends/duckdb.rs
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,7 @@ pub fn query(
} else {
query.to_string()
};
debug!("sql_query = {sql_query}");

// prepare the connection and statement
let conn = if database == "" {
Expand Down
4 changes: 2 additions & 2 deletions src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -152,7 +152,7 @@ fn main() -> Result<()> {
// args.sql
if !args.sql && !query.starts_with("prql ") {
// prepend a PRQL header to signal this is a PRQL query rather than a SQL one
query = format!("prql version:'0.4' dialect:ansi\n{query}")
query = format!("prql version:'0.4' target:sql.generic\n{query}")
}
debug!("query = {query:?}");

Expand Down Expand Up @@ -276,7 +276,7 @@ fn get_dest_from_to(to: &str) -> Result<Box<dyn Write>> {

fn get_sql_from_query(query: &str) -> Result<String> {
let sql = if query.starts_with("prql ") {
compile(query)?
compile(query, None).map_err(|e| anyhow!(e))?
} else {
query.to_string()
};
Expand Down

0 comments on commit 40102d0

Please sign in to comment.