Skip to content

how can I use Timestamp in diesel #4334

Answered by weiznich
xu756 asked this question in Q&A
Discussion options

You must be logged in to vote

This is an incomplete error message, checkout the full error message emitted by the compiler. It will contain more details.

That said, even this part already contains the following note:

double check your type mappings via the documentation of diesel::sql_types::Timestamp

The problem here is that diesel::sql_types::Timestamp cannot hold values at all as written in the crate documentation:

Diesel maps “Rust types” (e.g. i32) to and from “SQL types” (e.g. diesel::sql_types::Integer). You can find all the types supported by Diesel in the sql_types module. These types are only used to represent a SQL type. You should never put them on your Queryable structs.

Source

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by xu756
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants