I am trying to create a struct that I can use in diesel for insertion. Specifically I am making the struct Insertable. On compile I get this error.
I have a struct
You might reach this question by searching an error message that is really similar:
the trait `diesel::Expression` is not implemented for `(schema::..., schema::..., schema::...)`
This is just a reminder to count the number of columns you have in the table!{}
macro because you might be reaching the default 32 column limit.
According to the Diesel changelog you should use the following features if you use more than the default 32 columns.
diesel = { version = "1.4", features = [..., "64-column-tables"] }
diesel = { version = "1.4", features = [..., "128-column-tables"] }
Using more columns is not possible and might be a hint that the table design is not ideal (See: https://github.com/diesel-rs/diesel/issues/2312#issuecomment-591623303).