Skip to content

Conversation

@iamjpotts
Copy link
Contributor

@iamjpotts iamjpotts commented Aug 22, 2025

Does your PR solve an issue?

Resolves a deprecation warning caused by the chrono crate deprecating its Date type and the ymd method that returned a Date value.

Example of deprecation warning:

warning: use of deprecated method `sqlx::types::chrono::TimeZone::ymd`: use `with_ymd_and_hms()` instead
   --> tests/postgres/types.rs:355:67
    |
355 |             == FixedOffset::east_opt(60 * 60 * 6 + 1800).unwrap().ymd(2019, 1, 2).and_hms_micro_opt(5, 10, 20, 115100).unwrap()
    |                                                                   ^^^
    |
    = note: `#[warn(deprecated)]` on by default

Is this a breaking change?

No; only changes tests:

  • Replace deprecated builder methods with newer ones
  • Add -D warnings to RUSTFLAGS for postgres ci jobs, now that all of the compile warnings are resolved.

There is still a warning about cargo features, but that is not affected by -D warnings.

Signed-off-by: Joshua Potts <8704475+iamjpotts@users.noreply.github.com>
Signed-off-by: Joshua Potts <8704475+iamjpotts@users.noreply.github.com>
@iamjpotts iamjpotts force-pushed the jp/chrono-date-ymd-deprecation branch from 109fc95 to aa6e4d1 Compare August 22, 2025 03:16
@iamjpotts iamjpotts marked this pull request as ready for review August 22, 2025 03:29
@abonander abonander merged commit c5037f1 into launchbadge:main Aug 27, 2025
104 checks passed
JosiahParry pushed a commit to JosiahParry/sqlx that referenced this pull request Sep 24, 2025
…ods (launchbadge#3987)

* chore(deps): Resolve deprecation warning for chrono Date and ymd methods

Signed-off-by: Joshua Potts <8704475+iamjpotts@users.noreply.github.com>

* chore(ci): Fail postgres tests if compiling them generates warnings

Signed-off-by: Joshua Potts <8704475+iamjpotts@users.noreply.github.com>

---------

Signed-off-by: Joshua Potts <8704475+iamjpotts@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants