-
Notifications
You must be signed in to change notification settings - Fork 1.3k
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
sqlx uses chrono instead of time #2689
Comments
Would you be able to provide a sqlx/sqlx-macros-core/src/database/postgres.rs Lines 29 to 57 in d0fbe7f
|
@saiintbrisson Yeah, will do. I’m on vacation ATM. I’ll post the lock file as soon as I get to my laptop. |
@saiintbrisson Here it is:
|
I have the same issue! (For me it's oauth2 and openidconnect which are bringing chrono as a dependency) Is there a known workaround ? |
@julien-leclercq none that I can think of atm, #2697 is a probable fix, but I haven't gotten any reactions there from the maintainers |
@saiintbrisson thanks, I temporarily switched to chrono. Glad that this kind of stuff happens so early in my project 😅. |
See: #2697 (comment) |
Bug Description
SQLx uses
chrono
types even iftime
feature is specified.In
Cargo.toml
:Column in Postgres:
Rust model:
Query:
When I run
cargo sqlx prepare
, it finishes without errors.Then, when I compile the binary, I get the following error:
As soon as I replace
time::OffsetDateTime
withchrono::DateTime<Utc>
in the Rust type without changing anything else, the binary compiles.Info
0.7.1
"runtime-tokio", "postgres", "tls-rustls", "uuid", "time"
Postgres 15.2
macOS 13.4
rustc --version
:rustc 1.70.0 (90c541806 2023-05-31)
The text was updated successfully, but these errors were encountered: