From 46e7691c7ed9ce233d2a3124a47cb0e7d22a5a5c Mon Sep 17 00:00:00 2001 From: Kasper Marstal Date: Sun, 14 Jul 2024 14:35:24 -0700 Subject: [PATCH] Bump prql (#56) --- Cargo.lock | 77 ++++++++++++++++++++++++++--------------- Cargo.toml | 4 +++ README.md | 4 +-- plprql-tests/Cargo.toml | 4 +-- plprql/Cargo.toml | 6 ++-- plprql/src/plprql.rs | 3 +- 6 files changed, 63 insertions(+), 35 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 8586e26..1602c01 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -61,15 +61,16 @@ dependencies = [ [[package]] name = "anstream" -version = "0.6.13" +version = "0.6.14" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d96bd03f33fe50a863e394ee9718a706f988b9079b20c3784fb726e7678b62fb" +checksum = "418c75fa768af9c03be99d17643f93f79bbba589895012a80e3452a19ddda15b" dependencies = [ "anstyle", "anstyle-parse", "anstyle-query", "anstyle-wincon", "colorchoice", + "is_terminal_polyfill", "utf8parse", ] @@ -109,9 +110,9 @@ dependencies = [ [[package]] name = "anyhow" -version = "1.0.82" +version = "1.0.86" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f538837af36e6f6a9be0faa67f9a314f8119e4e4b5867c6ab40ed60360142519" +checksum = "b3d1d046238990b9cf5bcde22a3fb3584ee5cf65fb2765f454ed428c7a0063da" dependencies = [ "backtrace", ] @@ -366,6 +367,16 @@ dependencies = [ "doc-comment", ] +[[package]] +name = "clap-verbosity-flag" +version = "2.1.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b57f73ca21b17a0352944b9bb61803b6007bd911b6cccfef7153f7f0600ac495" +dependencies = [ + "clap", + "log", +] + [[package]] name = "clap_builder" version = "4.5.2" @@ -381,9 +392,9 @@ dependencies = [ [[package]] name = "clap_complete" -version = "4.5.2" +version = "4.4.10" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dd79504325bf38b10165b02e89b4347300f855f273c4cb30c4a3209e6583275e" +checksum = "abb745187d7f4d76267b37485a65e0149edd0e91a4cfcdd3f27524ad86cee9f3" dependencies = [ "clap", ] @@ -1025,6 +1036,12 @@ version = "1.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "7655c9839580ee829dfacba1d1278c2b7883e50a277ff7541299489d6bdfdc45" +[[package]] +name = "is_terminal_polyfill" +version = "1.70.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f8478577c03552c21db0e2724ffb8986a5ce7af88107e6be5d2ee6e158c12800" + [[package]] name = "itertools" version = "0.12.1" @@ -1162,9 +1179,9 @@ dependencies = [ [[package]] name = "minijinja" -version = "0.31.0" +version = "2.0.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "673d1ece89f7e166f43270800d78f9b1a9d21fda92dbcfa3b98b21213cdccbbc" +checksum = "933ee10775d58fca8238a84fe165dfe4bde8b07d7574f24d76ffea91170f3ac6" dependencies = [ "serde", ] @@ -1582,16 +1599,16 @@ dependencies = [ [[package]] name = "prqlc" -version = "0.11.3" +version = "0.12.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4beb05b6b71ce096fa56d73006ab1c42a8d11bf190d193fa511a134f7730ec43" +checksum = "57894e5531a475a6ea4bb3be9b5824f84fed1ea81280819791447a773163000c" dependencies = [ "anstream", "anyhow", "ariadne", - "atty", "chrono", "clap", + "clap-verbosity-flag", "clap_complete", "clap_complete_command", "clio", @@ -1600,6 +1617,7 @@ dependencies = [ "csv", "enum-as-inner", "env_logger", + "is-terminal", "itertools", "log", "minijinja", @@ -1609,7 +1627,7 @@ dependencies = [ "prqlc-ast", "prqlc-parser", "regex", - "semver 1.0.22", + "semver 1.0.23", "serde", "serde_json", "serde_yaml", @@ -1622,27 +1640,32 @@ dependencies = [ [[package]] name = "prqlc-ast" -version = "0.11.3" +version = "0.12.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c98923b046bc48046e3846b14a5fde5a059f681c7c367bd0ab96ebd3ecc33a71" +checksum = "7392fb56fbf926ea290e514b8c40192e3f447489d2d1a188aef1f5d7401196c2" dependencies = [ - "anyhow", + "chumsky", "enum-as-inner", - "semver 1.0.22", + "semver 1.0.23", "serde", + "serde_yaml", + "stacker", "strum", ] [[package]] name = "prqlc-parser" -version = "0.11.3" +version = "0.12.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "855ad9aba599ef608efc88a30ebd731155997d9bbe780639eb175de060b6cddc" +checksum = "eaa919a403dcf3c2fe7d7f4a9f60d8e0ed03dc8838bdd6bf017b1d411aa23b50" dependencies = [ "chumsky", "itertools", + "log", "prqlc-ast", - "semver 1.0.22", + "semver 1.0.23", + "serde", + "serde_yaml", "stacker", ] @@ -1820,7 +1843,7 @@ version = "0.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "bfa0f585226d2e68097d4f95d113b15b83a82e819ab25717ec0590d9584ef366" dependencies = [ - "semver 1.0.22", + "semver 1.0.23", ] [[package]] @@ -1892,9 +1915,9 @@ dependencies = [ [[package]] name = "semver" -version = "1.0.22" +version = "1.0.23" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "92d43fe69e652f3df9bdc2b85b2854a0825b86e4fb76bc44d945137d053639ca" +checksum = "61697e0a1c7e512e84a621326239844a24d8207b4669b41bc18b32ea5cbf988b" dependencies = [ "serde", ] @@ -2062,9 +2085,9 @@ dependencies = [ [[package]] name = "sqlparser" -version = "0.43.1" +version = "0.47.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f95c4bae5aba7cd30bd506f7140026ade63cff5afd778af8854026f9606bf5d4" +checksum = "295e9930cd7a97e58ca2a070541a3ca502b17f5d1fa7157376d0fabd85324f25" dependencies = [ "log", "serde", @@ -2117,11 +2140,11 @@ dependencies = [ [[package]] name = "strum_macros" -version = "0.26.2" +version = "0.26.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c6cf59daf282c0a494ba14fd21610a0325f9f90ec9d1231dea26bcb1d696c946" +checksum = "4c6bee85a5a24955dc440386795aa378cd9cf82acd5f764469152d2270e581be" dependencies = [ - "heck 0.4.1", + "heck 0.5.0", "proc-macro2", "quote", "rustversion", diff --git a/Cargo.toml b/Cargo.toml index 95ada5c..74353d5 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -16,3 +16,7 @@ opt-level = 3 lto = "fat" codegen-units = 1 strip = "debuginfo" + +[workspace.dependencies] +pgrx = "=0.11.4" +pgrx-tests = "=0.11.4" diff --git a/README.md b/README.md index 60cc058..9fd63f9 100644 --- a/README.md +++ b/README.md @@ -93,10 +93,10 @@ For more information on PRQL, visit the PRQL [website](https://prql-lang.org/), > PRQL supports `select` statements only. `insert`, `update`, and `delete` statements, and your other database code, will continue to live in vanilla SQL, ORMs, or other database frameworks. ## Getting Started -The following installation guides works on Debian. +The following installation guides work on Ubuntu and Debian. ### Quickstart -Run these commands to install PL/PRQL and its dependencies for PostgreSQL 16: +Run these commands to install PL/PRQL and all of its dependencies for PostgreSQL 16: ```cmd sudo apt-get update && apt-get upgrade diff --git a/plprql-tests/Cargo.toml b/plprql-tests/Cargo.toml index 8f5fc84..f699e2d 100644 --- a/plprql-tests/Cargo.toml +++ b/plprql-tests/Cargo.toml @@ -16,9 +16,9 @@ pg16 = ["pgrx/pg16", "pgrx-tests/pg16"] pg_test = [] [dependencies] -pgrx = "=0.11.4" +pgrx = { workspace = true } serde = { version = "1.0.203", features = ["derive"] } serde_json = "1.0.118" [dev-dependencies] -pgrx-tests = "=0.11.4" +pgrx-tests = { workspace = true } diff --git a/plprql/Cargo.toml b/plprql/Cargo.toml index 2d834b9..ecc9d51 100644 --- a/plprql/Cargo.toml +++ b/plprql/Cargo.toml @@ -24,9 +24,9 @@ pg16 = ["pgrx/pg16", "pgrx-tests/pg16"] pg_test = [] [dependencies] -pgrx = { version = "=0.11.4" } -prqlc = { version = "0.11.3", features = ["postgres"] } +pgrx = { workspace = true } +prqlc = { version = "0.12.2", features = ["postgres"] } thiserror = "1.0.61" [dev-dependencies] -pgrx-tests = "=0.11.4" +pgrx-tests = { workspace = true } diff --git a/plprql/src/plprql.rs b/plprql/src/plprql.rs index 001903d..518992e 100644 --- a/plprql/src/plprql.rs +++ b/plprql/src/plprql.rs @@ -2,7 +2,7 @@ use crate::call::{call_scalar, call_setof_iterator, call_table_iterator}; use crate::err::{PlprqlError, PlprqlResult}; use crate::fun::{Function, Return}; use pgrx::prelude::*; -use prqlc::{compile, sql::Dialect, Options, Target}; +use prqlc::{compile, sql::Dialect, DisplayOptions, Options, Target}; #[pg_extern] pub fn prql_to_sql(prql: &str) -> PlprqlResult { @@ -11,6 +11,7 @@ pub fn prql_to_sql(prql: &str) -> PlprqlResult { target: Target::Sql(Some(Dialect::Postgres)), signature_comment: false, color: false, + display: DisplayOptions::Plain, }; compile(prql, opts).map_err(PlprqlError::PrqlError)