-
-
Notifications
You must be signed in to change notification settings - Fork 518
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
Handling MySQL & SQLite timestamp columns #345
Conversation
Hey @lz1998, could you please try this PR? sea-orm = { version = "0.4.0", git = "https://github.com/SeaQL/sea-orm.git", branch = "issues/344", ... } |
I have tried |
Is your entity file similar to below? Defining the timestamp column with type use sea_orm::entity::prelude::*;
#[derive(Clone, Debug, PartialEq, DeriveEntityModel)]
#[sea_orm(table_name = "applog")]
pub struct Model {
#[sea_orm(primary_key)]
pub id: i32,
pub action: String,
pub json: Json,
pub created_at: DateTimeWithTimeZone,
}
#[derive(Copy, Clone, Debug, EnumIter, DeriveRelation)]
pub enum Relation {}
impl ActiveModelBehavior for ActiveModel {} |
I don't think MySQL can work with |
(Continue our discussion on #344) |
So this PR is not needed now? |
You mean we have to wait for upstream release? So we have to defer this PR? |
I think we should split this PR in half. And release the hotfix part now. MySQL user should use Only after that happened, MySQL user could use |
d84558a
to
b5f3ba8
Compare
bc75b4b
to
e7d7962
Compare
7ce941b
to
33a87d7
Compare
Close as the SQLx PR is closed |
PR Info
DateTime<FixedOffset>
for SQLx MySQL & SQLite sea-query#197chrono::NaiveDateTime
on MySQL timestamp columns launchbadge/sqlx#1581Notes to MySQL User
MySQL user should use
sea_orm:: DateTimeWithTimeZone
for timestamp columns until SQLx upstream merged the PR and released it. Only after that happened, MySQL user could usesea_orm::DateTime
for timestamp columns.