Skip to content

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

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

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.

@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
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.

1 participant