diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 62370de..dd46bc8 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -33,7 +33,7 @@ jobs: --health-retries 5 env: - DATABASE_URL: postgresql://sqlm-test:sqlm-test@localhost/sqlm-test + DATABASE_URL: postgresql://sqlm-test:sqlm-test@localhost/sqlm-test steps: - name: Add build dependencies @@ -46,11 +46,9 @@ jobs: run: psql $DATABASE_URL < postgres/testdb.sql - name: Install ${{matrix.toolchain}} toolchain - uses: actions-rs/toolchain@v1 + uses: dtolnay/rust-toolchain@master with: - profile: minimal toolchain: ${{matrix.toolchain}} - override: true components: rustfmt, clippy - name: Install cargo-hack @@ -58,7 +56,7 @@ jobs: - name: Test run: cargo hack test --workspace --feature-powerset --depth 2 - + - name: Clippy run: cargo hack check --workspace --feature-powerset --depth 1 diff --git a/postgres-macros/Cargo.toml b/postgres-macros/Cargo.toml index 812a63e..4daa597 100644 --- a/postgres-macros/Cargo.toml +++ b/postgres-macros/Cargo.toml @@ -18,7 +18,7 @@ uuid = ["dep:uuid", "postgres/with-uuid-1"] [dependencies] ariadne = "0.4" -chumsky = "1.0.0-alpha.6" +chumsky = "1.0.0-alpha.7" dotenvy = "0.15" heck = "0.5" pgvector = { version = "0.4", features = ["postgres"], optional = true } @@ -29,7 +29,7 @@ rustls = { version = "0.23", default-features = false, features = ["ring"] } serde_json = { version = "1.0", optional = true } syn = { version = "2.0", features = ["full", "extra-traits"] } time = { version = "0.3", optional = true } -tokio-postgres-rustls = "0.12" +tokio-postgres-rustls = "0.13" uuid = { version = "1.4", optional = true } [dev-dependencies] diff --git a/postgres-macros/tests/fail-stable/date_vs_datetime.stderr b/postgres-macros/tests/fail-stable/date_vs_datetime.stderr index 151d2c0..e09a815 100644 --- a/postgres-macros/tests/fail-stable/date_vs_datetime.stderr +++ b/postgres-macros/tests/fail-stable/date_vs_datetime.stderr @@ -2,6 +2,6 @@ error[E0271]: type mismatch resolving `::Type == Date --> tests/fail-stable/date_vs_datetime.rs:5:62 | 5 | let _: time::OffsetDateTime = sql!("SELECT NOW()::DATE").await.unwrap(); - | ^^^^^ expected `Date`, found `OffsetDateTime` + | ^^^^^ expected `OffsetDateTime`, found `Date` | = note: required for `Sql<'_, Primitive, OffsetDateTime>` to implement `IntoFuture` diff --git a/postgres-macros/tests/fail-stable/datetime_vs_date.stderr b/postgres-macros/tests/fail-stable/datetime_vs_date.stderr index 9be00fd..9101391 100644 --- a/postgres-macros/tests/fail-stable/datetime_vs_date.stderr +++ b/postgres-macros/tests/fail-stable/datetime_vs_date.stderr @@ -2,6 +2,6 @@ error[E0271]: type mismatch resolving `::Type == OffsetDateTime --> tests/fail-stable/datetime_vs_date.rs:6:10 | 6 | .await - | ^^^^^ expected `OffsetDateTime`, found `Date` + | ^^^^^ expected `Date`, found `OffsetDateTime` | = note: required for `Sql<'_, Primitive, time::Date>` to implement `IntoFuture` diff --git a/postgres-macros/tests/fail-stable/enum_array_to_enum_literal.stderr b/postgres-macros/tests/fail-stable/enum_array_to_enum_literal.stderr index 5eff451..58988e9 100644 --- a/postgres-macros/tests/fail-stable/enum_array_to_enum_literal.stderr +++ b/postgres-macros/tests/fail-stable/enum_array_to_enum_literal.stderr @@ -4,10 +4,9 @@ error[E0277]: the trait bound `Role: sqlm_postgres::query::Query, EnumVariant<10465144470622129318>)>>>>` is not implemented for `Role`, which is required by `Sql<'_, sqlm_postgres::types::Array, EnumVariant<10465144470622129318>)>>>, _>: IntoFuture` | help: remove the `.await` | - = help: the trait `sqlm_postgres::query::Query, EnumVariant<10465144470622129318>)>>>>` is not implemented for `Role` = help: the following other types implement trait `sqlm_postgres::query::Query`: `()` implements `sqlm_postgres::query::Query<()>` `Option` implements `sqlm_postgres::query::Query::Type>>` diff --git a/postgres-macros/tests/fail-stable/enum_extra_variant.stderr b/postgres-macros/tests/fail-stable/enum_extra_variant.stderr index b8f1338..b8f84c7 100644 --- a/postgres-macros/tests/fail-stable/enum_extra_variant.stderr +++ b/postgres-macros/tests/fail-stable/enum_extra_variant.stderr @@ -4,10 +4,9 @@ error[E0277]: the trait bound `Vec: sqlm_postgres::query::Query = sql!("SELECT id, role FROM users").await.unwrap(); | -^^^^^ | || - | |unsatisfied trait bound + | |the trait `sqlm_postgres::query::Query, StructColumn, EnumVariant<10465144470622129318>)>, 18137070463969723500>)>>` is not implemented for `Vec`, which is required by `Sql<'_, Struct<(StructColumn, StructColumn, EnumVariant<10465144470622129318>)>, 18137070463969723500>)>, _>: IntoFuture` | help: remove the `.await` | - = help: the trait `sqlm_postgres::query::Query, StructColumn, EnumVariant<10465144470622129318>)>, 18137070463969723500>)>>` is not implemented for `Vec` = help: the following other types implement trait `sqlm_postgres::query::Query`: `Vec` implements `sqlm_postgres::query::Query::Type>>` `Vec` implements `sqlm_postgres::query::Query>` diff --git a/postgres-macros/tests/fail-stable/enum_missing_variant.stderr b/postgres-macros/tests/fail-stable/enum_missing_variant.stderr index 875576f..a2ddd61 100644 --- a/postgres-macros/tests/fail-stable/enum_missing_variant.stderr +++ b/postgres-macros/tests/fail-stable/enum_missing_variant.stderr @@ -4,10 +4,9 @@ error[E0277]: the trait bound `Vec: sqlm_postgres::query::Query = sql!("SELECT id, role FROM users").await.unwrap(); | -^^^^^ | || - | |unsatisfied trait bound + | |the trait `sqlm_postgres::query::Query, StructColumn, EnumVariant<10465144470622129318>)>, 18137070463969723500>)>>` is not implemented for `Vec`, which is required by `Sql<'_, Struct<(StructColumn, StructColumn, EnumVariant<10465144470622129318>)>, 18137070463969723500>)>, _>: IntoFuture` | help: remove the `.await` | - = help: the trait `sqlm_postgres::query::Query, StructColumn, EnumVariant<10465144470622129318>)>, 18137070463969723500>)>>` is not implemented for `Vec` = help: the following other types implement trait `sqlm_postgres::query::Query`: `Vec` implements `sqlm_postgres::query::Query::Type>>` `Vec` implements `sqlm_postgres::query::Query>` diff --git a/postgres-macros/tests/fail-stable/enum_variant_mismatch.stderr b/postgres-macros/tests/fail-stable/enum_variant_mismatch.stderr index 275ee98..f6ffac8 100644 --- a/postgres-macros/tests/fail-stable/enum_variant_mismatch.stderr +++ b/postgres-macros/tests/fail-stable/enum_variant_mismatch.stderr @@ -4,10 +4,9 @@ error[E0277]: the trait bound `Vec: sqlm_postgres::query::Query = sql!("SELECT id, role FROM users").await.unwrap(); | -^^^^^ | || - | |unsatisfied trait bound + | |the trait `sqlm_postgres::query::Query, StructColumn, EnumVariant<10465144470622129318>)>, 18137070463969723500>)>>` is not implemented for `Vec`, which is required by `Sql<'_, Struct<(StructColumn, StructColumn, EnumVariant<10465144470622129318>)>, 18137070463969723500>)>, _>: IntoFuture` | help: remove the `.await` | - = help: the trait `sqlm_postgres::query::Query, StructColumn, EnumVariant<10465144470622129318>)>, 18137070463969723500>)>>` is not implemented for `Vec` = help: the following other types implement trait `sqlm_postgres::query::Query`: `Vec` implements `sqlm_postgres::query::Query::Type>>` `Vec` implements `sqlm_postgres::query::Query>` diff --git a/postgres-macros/tests/fail-stable/literal_array_to_literal.stderr b/postgres-macros/tests/fail-stable/literal_array_to_literal.stderr index 13cc4db..93cb206 100644 --- a/postgres-macros/tests/fail-stable/literal_array_to_literal.stderr +++ b/postgres-macros/tests/fail-stable/literal_array_to_literal.stderr @@ -4,7 +4,7 @@ error[E0277]: the trait bound `String: sqlm_postgres::query::Query>>` is not implemented for `String` + | |the trait `sqlm_postgres::query::Query>>` is not implemented for `String`, which is required by `Sql<'_, sqlm_postgres::types::Array>, _>: IntoFuture` | help: remove the `.await` | = help: the following other types implement trait `sqlm_postgres::query::Query`: diff --git a/postgres-macros/tests/fail-stable/scalar_mismatch.stderr b/postgres-macros/tests/fail-stable/scalar_mismatch.stderr index 1b0e32f..950101e 100644 --- a/postgres-macros/tests/fail-stable/scalar_mismatch.stderr +++ b/postgres-macros/tests/fail-stable/scalar_mismatch.stderr @@ -2,6 +2,6 @@ error[E0271]: type mismatch resolving `::Type == i64` --> tests/fail-stable/scalar_mismatch.rs:5:56 | 5 | let _: String = sql!("SELECT COUNT(*) FROM users").await.unwrap(); - | ^^^^^ expected `i64`, found `String` + | ^^^^^ expected `String`, found `i64` | = note: required for `Sql<'_, Primitive, String>` to implement `IntoFuture` diff --git a/postgres/Cargo.toml b/postgres/Cargo.toml index 6bd88ad..4d90ab9 100644 --- a/postgres/Cargo.toml +++ b/postgres/Cargo.toml @@ -30,7 +30,7 @@ serde_json = { version = "1.0", optional = true } sqlm-postgres-macros = { path = "../postgres-macros", version = "0.1", default-features = false } time = { version = "0.3", optional = true } tokio-postgres = "0.7" -tokio-postgres-rustls = "0.12" +tokio-postgres-rustls = "0.13" tracing = "0.1" uuid = { version = "1.4", optional = true }