From 7cf4f4e2e866bbbe7fd12890a0883d1fefbbefce Mon Sep 17 00:00:00 2001 From: Joshua Potts <8704475+iamjpotts@users.noreply.github.com> Date: Thu, 21 Aug 2025 22:53:04 -0400 Subject: [PATCH 1/2] chore(deps): Resolve deprecation warning for chrono Date and ymd methods Signed-off-by: Joshua Potts <8704475+iamjpotts@users.noreply.github.com> --- tests/postgres/types.rs | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/tests/postgres/types.rs b/tests/postgres/types.rs index 420e9732f3..c923422e53 100644 --- a/tests/postgres/types.rs +++ b/tests/postgres/types.rs @@ -330,7 +330,15 @@ mod chrono { test_type!(chrono_date_time_tz>(Postgres, "TIMESTAMPTZ '2019-01-02 05:10:20.115100+06:30'" - == FixedOffset::east_opt(60 * 60 * 6 + 1800).unwrap().ymd(2019, 1, 2).and_hms_micro_opt(5, 10, 20, 115100).unwrap() + == FixedOffset::east_opt(60 * 60 * 6 + 1800) + .unwrap() + .from_local_datetime( + &NaiveDate::from_ymd_opt(2019, 1, 2) + .unwrap() + .and_hms_micro_opt(5, 10, 20, 115_100) + .unwrap() + ) + .unwrap() )); test_type!(chrono_date_time_tz_vec>>(Postgres, From aa6e4d14bfe5c0cafab0f3da36bb2decafae821c Mon Sep 17 00:00:00 2001 From: Joshua Potts <8704475+iamjpotts@users.noreply.github.com> Date: Thu, 21 Aug 2025 23:00:05 -0400 Subject: [PATCH 2/2] chore(ci): Fail postgres tests if compiling them generates warnings Signed-off-by: Joshua Potts <8704475+iamjpotts@users.noreply.github.com> --- .github/workflows/sqlx.yml | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/.github/workflows/sqlx.yml b/.github/workflows/sqlx.yml index 05d5da0a3b..6ca92f0e20 100644 --- a/.github/workflows/sqlx.yml +++ b/.github/workflows/sqlx.yml @@ -243,7 +243,7 @@ jobs: env: DATABASE_URL: postgres://postgres:password@localhost:5432/sqlx SQLX_OFFLINE_DIR: .sqlx - RUSTFLAGS: --cfg postgres="${{ matrix.postgres }}" + RUSTFLAGS: -D warnings --cfg postgres="${{ matrix.postgres }}" # Run the `test-attr` test again to cover cleanup. - run: > @@ -254,7 +254,7 @@ jobs: env: DATABASE_URL: postgres://postgres:password@localhost:5432/sqlx SQLX_OFFLINE_DIR: .sqlx - RUSTFLAGS: --cfg postgres="${{ matrix.postgres }}" + RUSTFLAGS: -D warnings --cfg postgres="${{ matrix.postgres }}" - if: matrix.tls != 'none' run: > @@ -264,7 +264,7 @@ jobs: env: DATABASE_URL: postgres://postgres:password@localhost:5432/sqlx?sslmode=verify-ca&sslrootcert=.%2Ftests%2Fcerts%2Fca.crt SQLX_OFFLINE_DIR: .sqlx - RUSTFLAGS: --cfg postgres="${{ matrix.postgres }}" + RUSTFLAGS: -D warnings --cfg postgres="${{ matrix.postgres }}" # Remove test artifacts - run: cargo clean -p sqlx @@ -290,7 +290,7 @@ jobs: DATABASE_URL: postgres://postgres:password@localhost:5432/sqlx SQLX_OFFLINE: true SQLX_OFFLINE_DIR: .sqlx - RUSTFLAGS: --cfg postgres="${{ matrix.postgres }}" + RUSTFLAGS: -D warnings --cfg postgres="${{ matrix.postgres }}" postgres-ssl-auth: name: Postgres SSL Auth @@ -322,7 +322,7 @@ jobs: --features any,postgres,macros,_unstable-all-types,runtime-${{ matrix.runtime }},tls-${{ matrix.tls }} env: DATABASE_URL: postgres://postgres@localhost:5432/sqlx?sslmode=verify-ca&sslrootcert=.%2Ftests%2Fcerts%2Fca.crt&sslkey=.%2Ftests%2Fcerts%2Fkeys%2Fclient.key&sslcert=.%2Ftests%2Fcerts%2Fclient.crt - RUSTFLAGS: --cfg postgres="${{ matrix.postgres }}" + RUSTFLAGS: -D warnings --cfg postgres="${{ matrix.postgres }}" mysql: name: MySQL