-
Notifications
You must be signed in to change notification settings - Fork 212
Convert all timestamps to TIMESTAMP WITH TIMEZONE #1067
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
Comments
|
Hmm, I'm curious why you say that. The first thing we always do fetching them from the database is to add the timezone: https://github.com/rust-lang/docs.rs/blob/master/src/web/releases.rs#L104 |
Yep, because we're explicitly storing UTC timestamps in the database. Using |
It looks like sqlx should be fine with converting between |
Unfortunately it does not: error[E0308]: mismatched types
--> src/web/builds.rs:52:9
|
52 | / query_as!(
53 | | Build,
54 | | "SELECT
55 | | builds.id,
... |
67 | | version,
68 | | )
| |_________^ expected struct `chrono::DateTime`, found struct `chrono::NaiveDateTime`
|
= note: expected struct `chrono::DateTime<chrono::Utc>`
found struct `chrono::NaiveDateTime`
= note: this error originates in a macro (in Nightly builds, run with -Z macro-backtrace for more info) |
Given that launchbadge/sqlx#703 is not possible to hit in practice since the binary protocol is always used, and it not being possible to tell sqlx that our |
I had some time on my hands and created a first PR in #1223 |
we can close that one, right? |
This came up while working on #874, but it's good practice anyway. We store them in Rust as
DateTime<Utc>
, it should be the same in the database.The text was updated successfully, but these errors were encountered: