diff --git a/CHANGELOG.md b/CHANGELOG.md index 4ad039f..f890e62 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -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 diff --git a/Cargo.lock b/Cargo.lock index 7f7da56..13b5faf 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -2338,9 +2338,9 @@ dependencies = [ [[package]] name = "prql-compiler" -version = "0.4.1" +version = "0.4.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e37379831b032690d951af0623358ff75806c35e1ef93d34a4b99688a20e3515" +checksum = "695c1a8eb470d6fcd9cda81a4af75a4c5add357b2c1f97d7c320216651acf78c" dependencies = [ "anyhow", "ariadne", @@ -2365,7 +2365,7 @@ dependencies = [ [[package]] name = "prql-query" -version = "0.0.14" +version = "0.0.15" dependencies = [ "anyhow", "arrow 23.0.0", diff --git a/Cargo.toml b/Cargo.toml index 9708de9..347892e 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -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" @@ -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" diff --git a/src/backends/duckdb.rs b/src/backends/duckdb.rs index bb21e87..67d3df6 100644 --- a/src/backends/duckdb.rs +++ b/src/backends/duckdb.rs @@ -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 == "" { diff --git a/src/main.rs b/src/main.rs index f58f250..24ca0c3 100644 --- a/src/main.rs +++ b/src/main.rs @@ -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:?}"); @@ -276,7 +276,7 @@ fn get_dest_from_to(to: &str) -> Result> { fn get_sql_from_query(query: &str) -> Result { let sql = if query.starts_with("prql ") { - compile(query)? + compile(query, None).map_err(|e| anyhow!(e))? } else { query.to_string() };