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
Using the type Nullable<diesel::sqlite::sql_types::Timestamptz> together with the Rust type Option<chrono::DateTime<chrono::Local>> throws compiler trait not implemented errors. Using diesel::sql_types::TimestamptzSqlite does not, even though they should be equivalent.
What are you trying to accomplish?
Loading a Nullable Sqlite Timestamp column into a chrono datetime option field.
What is the expected output?
No compiler errors
What is the actual output?
error[E0277]: the trait bound `Timestamptz: diesel::sql_types::ops::Add` is not satisfied
--> hackgregator/src/schema.rs:3:1
|
3 | / diesel::table! {4 | | items (id){5 | | id -> Integer,
6 | | #[sql_name = "type"]
... |
11 | | by -> Nullable<Text>,
12 | | time -> Nullable<diesel::sqlite::sql_types::Timestamptz>,
| |____________^ the trait `diesel::sql_types::ops::Add` is not implemented for `Timestamptz`
|
= help: the following other types implement trait `diesel::sql_types::ops::Add`:BigInt
diesel::sql_types::Date
diesel::sql_types::Double
diesel::sql_types::Float
diesel::sql_types::Integer
diesel::sql_types::Interval
diesel::sql_types::Nullable<T>
diesel::sql_types::Numeric
and 3 others
= note: required for `diesel::sql_types::Nullable<Timestamptz>` to implement `diesel::sql_types::ops::Add`
= note: this error originates in the macro `diesel::table` (in Nightly builds, run with -Z macro-backtrace for more info)
error[E0277]: the trait bound `Timestamptz: diesel::sql_types::ops::Add` is not satisfied
--> hackgregator/src/schema.rs:3:1
|
3 | / diesel::table! {4 | | items (id){5 | | id -> Integer,
6 | | #[sql_name = "type"]
... |
15 | | }16 | | }
| |_^ the trait `diesel::sql_types::ops::Add` is not implemented for `Timestamptz`
|
= help: the following other types implement trait `diesel::sql_types::ops::Add`:BigInt
diesel::sql_types::Date
diesel::sql_types::Double
diesel::sql_types::Float
diesel::sql_types::Integer
diesel::sql_types::Interval
diesel::sql_types::Nullable<T>
diesel::sql_types::Numeric
and 3 others
= note: required for `diesel::sql_types::Nullable<Timestamptz>` to implement `diesel::sql_types::ops::Add`
= note: this error originates in the macro `diesel::table` (in Nightly builds, run with -Z macro-backtrace for more info)
error[E0277]: the trait bound `Rhs: diesel::Expression` is not satisfied
--> hackgregator/src/schema.rs:3:1
|
3 | / diesel::table! {4 | | items (id){5 | | id -> Integer,
6 | | #[sql_name = "type"]
... |
15 | | }16 | | }
| |_^ the trait `diesel::Expression` is not implemented for `Rhs`
|
= note: required for `Rhs` to implement `AsExpression<diesel::sql_types::Nullable<_>>`
= note: this error originates in the macro `diesel::table` (in Nightly builds, run with -Z macro-backtrace for more info)
help: consider further restricting type parameter `Rhs`
|
16 | }, Rhs: diesel::Expression
| +++++++++++++++++++++++++
error[E0277]: the trait bound `Timestamptz: diesel::sql_types::ops::Sub` is not satisfied
--> hackgregator/src/schema.rs:3:1
|
3 | / diesel::table! {4 | | items (id){5 | | id -> Integer,
6 | | #[sql_name = "type"]
... |
11 | | by -> Nullable<Text>,
12 | | time -> Nullable<diesel::sqlite::sql_types::Timestamptz>,
| |____________^ the trait `diesel::sql_types::ops::Sub` is not implemented for `Timestamptz`
|
= help: the following other types implement trait `diesel::sql_types::ops::Sub`:BigInt
diesel::sql_types::Date
diesel::sql_types::Double
diesel::sql_types::Float
diesel::sql_types::Integer
diesel::sql_types::Interval
diesel::sql_types::Nullable<T>
diesel::sql_types::Numeric
and 3 others
= note: required for `diesel::sql_types::Nullable<Timestamptz>` to implement `diesel::sql_types::ops::Sub`
= note: this error originates in the macro `diesel::table` (in Nightly builds, run with -Z macro-backtrace for more info)
error[E0277]: the trait bound `Timestamptz: diesel::sql_types::ops::Sub` is not satisfied
--> hackgregator/src/schema.rs:3:1
|
3 | / diesel::table! {4 | | items (id){5 | | id -> Integer,
6 | | #[sql_name = "type"]
... |
15 | | }16 | | }
| |_^ the trait `diesel::sql_types::ops::Sub` is not implemented for `Timestamptz`
|
= help: the following other types implement trait `diesel::sql_types::ops::Sub`:BigInt
diesel::sql_types::Date
diesel::sql_types::Double
diesel::sql_types::Float
diesel::sql_types::Integer
diesel::sql_types::Interval
diesel::sql_types::Nullable<T>
diesel::sql_types::Numeric
and 3 others
= note: required for `diesel::sql_types::Nullable<Timestamptz>` to implement `diesel::sql_types::ops::Sub`
= note: this error originates in the macro `diesel::table` (in Nightly builds, run with -Z macro-backtrace for more info)
error[E0277]: the trait bound `Timestamptz: diesel::sql_types::ops::Add` is not satisfied
--> hackgregator/src/schema.rs:3:1
|
3 | / diesel::table! {4 | | items (id){5 | | id -> Integer,
6 | | #[sql_name = "type"]
... |
15 | | }16 | | }
| |_^ the trait `diesel::sql_types::ops::Add` is not implemented for `Timestamptz`
|
= help: the following other types implement trait `diesel::sql_types::ops::Add`:BigInt
diesel::sql_types::Date
diesel::sql_types::Double
diesel::sql_types::Float
diesel::sql_types::Integer
diesel::sql_types::Interval
diesel::sql_types::Nullable<T>
diesel::sql_types::Numeric
and 3 others
= note: required for `diesel::sql_types::Nullable<Timestamptz>` to implement `diesel::sql_types::ops::Add`
note: required for `columns::time` to implement `std::ops::Add<Rhs>`
--> hackgregator/src/schema.rs:3:1
|
3 | / diesel::table! {4 | | items (id){5 | | id -> Integer,
6 | | #[sql_name = "type"]
... |
12 | | time -> Nullable<diesel::sqlite::sql_types::Timestamptz>,
| | ^^^^
... |
15 | | }16 | | }
| |_^
= note: this error originates in the macro `diesel::table` (in Nightly builds, run with -Z macro-backtrace for more info)
error[E0277]: the trait bound `Rhs: diesel::Expression` is not satisfied
--> hackgregator/src/schema.rs:3:1
|
3 | / diesel::table! {4 | | items (id){5 | | id -> Integer,
6 | | #[sql_name = "type"]
... |
15 | | }16 | | }
| |_^ the trait `diesel::Expression` is not implemented for `Rhs`
|
= note: required for `Rhs` to implement `AsExpression<diesel::sql_types::Nullable<_>>`
note: required for `columns::time` to implement `std::ops::Add<Rhs>`
--> hackgregator/src/schema.rs:3:1
|
3 | / diesel::table! {4 | | items (id){5 | | id -> Integer,
6 | | #[sql_name = "type"]
... |
12 | | time -> Nullable<diesel::sqlite::sql_types::Timestamptz>,
| | ^^^^
... |
15 | | }16 | | }
| |_^
= note: this error originates in the macro `diesel::table` (in Nightly builds, run with -Z macro-backtrace for more info)
help: consider further restricting type parameter `Rhs`
|
16 | }, Rhs: diesel::Expression
| +++++++++++++++++++++++++
error[E0277]: the trait bound `Timestamptz: diesel::sql_types::ops::Sub` is not satisfied
--> hackgregator/src/schema.rs:3:1
|
3 | / diesel::table! {4 | | items (id){5 | | id -> Integer,
6 | | #[sql_name = "type"]
... |
15 | | }16 | | }
| |_^ the trait `diesel::sql_types::ops::Sub` is not implemented for `Timestamptz`
|
= help: the following other types implement trait `diesel::sql_types::ops::Sub`:BigInt
diesel::sql_types::Date
diesel::sql_types::Double
diesel::sql_types::Float
diesel::sql_types::Integer
diesel::sql_types::Interval
diesel::sql_types::Nullable<T>
diesel::sql_types::Numeric
and 3 others
= note: required for `diesel::sql_types::Nullable<Timestamptz>` to implement `diesel::sql_types::ops::Sub`
note: required for `columns::time` to implement `std::ops::Sub<Rhs>`
--> hackgregator/src/schema.rs:3:1
|
3 | / diesel::table! {4 | | items (id){5 | | id -> Integer,
6 | | #[sql_name = "type"]
... |
12 | | time -> Nullable<diesel::sqlite::sql_types::Timestamptz>,
| | ^^^^
... |
15 | | }16 | | }
| |_^
= note: this error originates in the macro `diesel::table` (in Nightly builds, run with -Z macro-backtrace for more info)
error[E0277]: the trait bound `Rhs: diesel::Expression` is not satisfied
--> hackgregator/src/schema.rs:3:1
|
3 | / diesel::table! {4 | | items (id){5 | | id -> Integer,
6 | | #[sql_name = "type"]
... |
15 | | }16 | | }
| |_^ the trait `diesel::Expression` is not implemented for `Rhs`
|
= note: required for `Rhs` to implement `AsExpression<diesel::sql_types::Nullable<_>>`
note: required for `columns::time` to implement `std::ops::Sub<Rhs>`
--> hackgregator/src/schema.rs:3:1
|
3 | / diesel::table! {4 | | items (id){5 | | id -> Integer,
6 | | #[sql_name = "type"]
... |
12 | | time -> Nullable<diesel::sqlite::sql_types::Timestamptz>,
| | ^^^^
... |
15 | | }16 | | }
| |_^
= note: this error originates in the macro `diesel::table` (in Nightly builds, run with -Z macro-backtrace for more info)
help: consider further restricting type parameter `Rhs`
|
16 | }, Rhs: diesel::Expression
| +++++++++++++++++++++++++
For more information about this error, try `rustc --explain E0277`.
error: could not compile `hackgregator` (bin "hackgregator") due to 9 previous errors
Steps to reproduce
// schema.rs
diesel::table! {
items (id){
id -> Integer,
time -> Nullable<diesel::sql_types::TimestamptzSqlite>,
}}
Setup
Versions
Feature Flags
Problem Description
Using the type
Nullable<diesel::sqlite::sql_types::Timestamptz>
together with the Rust typeOption<chrono::DateTime<chrono::Local>>
throws compiler trait not implemented errors. Usingdiesel::sql_types::TimestamptzSqlite
does not, even though they should be equivalent.What are you trying to accomplish?
Loading a Nullable Sqlite Timestamp column into a chrono datetime option field.
What is the expected output?
No compiler errors
What is the actual output?
Steps to reproduce
Checklist
closed if this is not the case)
The text was updated successfully, but these errors were encountered: