Skip to content

fix(macros): only enable chrono when time is disabled - #2697

Merged
abonander merged 1 commit into
transact-rs:mainfrom
saiintbrisson:fix/macros/chrono-or-time
Mar 12, 2024
Merged

abonander merged 1 commit into
transact-rs:mainfrom
saiintbrisson:fix/macros/chrono-or-time

Conversation

@saiintbrisson

Copy link
Copy Markdown
Contributor

Replicates the same approach done by the MySQL compatibility layer and only enables chrono types
if time is disabled.

I expect this to close #2689.

@saiintbrisson

saiintbrisson commented Sep 14, 2023 •

Copy link
Copy Markdown
Contributor Author

@abonander sorry for the ping. There were more complaints of this happening on #2689, and given the way Cargo manages features, this is probably not so uncommon. I guess this is why crates like tokio-postgres have the with- prefix on features.

@abonander

abonander commented Oct 12, 2023 •

Copy link
Copy Markdown
Collaborator

This is unfortunately a breaking change for people who have already worked around the problem by using chrono locally. I'll accept the PR if only to make the behavior consistent between databases but it will have to wait for the next major release either way.

And really, it just means chrono users will run into the exact same issue if a dependency enables time. It's not a real solution.

What we really need is a way to specify which crate to use outside of Cargo features, like perhaps with #121

@abonander
abonander merged commit f316b0d into transact-rs:main Mar 12, 2024
abonander added a commit that referenced this pull request Jul 23, 2024
jrasanen pushed a commit to jrasanen/sqlx that referenced this pull request Oct 14, 2024
jrasanen pushed a commit to jrasanen/sqlx that referenced this pull request Oct 14, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

sqlx uses chrono instead of time

2 participants