-
-
Notifications
You must be signed in to change notification settings - Fork 521
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
How to define rust type of TIMESTAMP? #344
Comments
We can use |
Yes, it should. I discover that for MySQL, it's blocked by SQLx. See launchbadge/sqlx#1581 |
I think the reason for SQLx not supporting https://medium.com/@kenny_7143/time-zone-in-mysql-e7b73c70fd4e
They usually are |
I think we should support |
Temporary Fix: Handling MySQL & SQLite timestamp columns
Discussed in #341
Originally posted by lz1998 December 1, 2021
I have tried 4 types, never of them works.
NaiveDateTime
,i64
,DateTime<Utc>
andDateTime<FixedOffset>
I use MySQL 8. I create table by myself without
automigrate
, and I define rust struct by myself.NaiveDateTime
andi64
Err(Query("error occurred while decoding column \"created_at\": mismatched types; Rust type `core::option::Option<chrono::naive::datetime::NaiveDateTime>` (as SQL type `DATETIME`) is not compatible with SQL type `TIMESTAMP`"))
DateTime<Utc>
andDateTime<FixedOffset>
The text was updated successfully, but these errors were encountered: