Join GitHub today
GitHub is home to over 28 million developers working together to host and review code, manage projects, and build software together.
Sign upSome(diesel::expression::now) fails to set Nullable<Timestamp> value #911
Comments
This comment has been minimized.
|
|
sgrif
closed this
May 15, 2017
This comment has been minimized.
Nemo157
commented
May 15, 2017
•
|
Ok, I think I understand, there's actually sort of two parallel worlds of Rust values and SQL expressions which use either |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Nemo157 commentedMay 15, 2017
•
edited
Judging by
impl Expression<SqlType = Timestamp> for now+impl<T, ST> AsExpression<Nullable<ST>> for Option<T> where ST: NotNullit seems like this should work, and the error message makes me think it has made it past that stage of the type checking, but for some reason the resultingUpdateStatementdoesn't implementExecuteDsl.A workaround is to just use
diesel::expression::sqlto bypass the type checking and injectCURRENT_TIMESTAMPdirectly:baz.eq(sql("CURRENT_TIMESTAMP")).