You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
error[E0277]: the trait bound `i64: diesel::Expression` is not satisfied
--> src\cache\models.rs:15:1
|
15 | #[derive(Debug, Insertable)]
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ the trait `diesel::Expression` is not implemented for `i64`
|
= note: required because of the requirements on the impl of `diesel::Expression` for `&'insert i64`
= note: required because of the requirements on the impl of `diesel::expression::AsExpression<diesel::types::Integer>` for `&'insert i64`
= note: this error originates in a macro outside of the current crate
error[E0277]: the trait bound `u32: diesel::Expression` is not satisfied
--> src\cache\models.rs:15:1
|
15 | #[derive(Debug, Insertable)]
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ the trait `diesel::Expression` is not implemented for `u32`
|
= note: required because of the requirements on the impl of `diesel::Expression` for `&'insert u32`
= note: required because of the requirements on the impl of `diesel::expression::AsExpression<diesel::types::Integer>` for `&'insert u32`
= note: this error originates in a macro outside of the current crate
error[E0277]: the trait bound `i64: diesel::Expression` is not satisfied
--> src\cache\models.rs:15:1
... etc
This error suggests that you can't insert integers? I can't imagine that is true, though the tests don't have any integers that aren't ids.
The text was updated successfully, but these errors were encountered:
The error message is telling you that you are using the wrong integer types. Integer is the equivalent to i32. If you want to use i64 in Rust, you should use BigInt instead. SQL does not have unsigned integers which is why you cannot use u32
INTEGER. The value is a signed integer, stored in 1, 2, 3, 4, 6, or 8 bytes depending on the magnitude of the value.
But as soon as INTEGER values are read off of disk and into memory for processing, they are converted to the most general datatype (8-byte signed integer).
This is probably a simple error, but there aren't really any docs about how
Insertable
works, and the compiler error is not helpful.Gives:
This error suggests that you can't insert integers? I can't imagine that is true, though the tests don't have any integers that aren't ids.
The text was updated successfully, but these errors were encountered: