Replies: 2 comments 3 replies
-
To cite from the ToSql documentation:
That's not the case for your implementation. Adding this derive should fix your issue. |
Beta Was this translation helpful? Give feedback.
1 reply
-
It started to throw a new error:
#[derive(Queryable, Selectable, Serialize, Deserialize)]
#[diesel(table_name = crate::path::to::schema)]
#[diesel(check_for_backend(diesel::pg::Pg))]
pub struct MyRow {
pub id: i32,
pub range: MyRangeInclusive
}
...
let test = my_table::table
.select(MyRow::as_select())
.load::<MyRow>(&mut conn)
.await?; |
Beta Was this translation helpful? Give feedback.
2 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
I need to store RangeInclusive in postgresql database but it does not seem to be implemented fully. I decided to write my own implementation, here is my code:
but when I tried to use it in table model:
it threw an error:
But documentation declares that if I have implemented
ToSql
then (logically) it should be implementedAsExpression
Beta Was this translation helpful? Give feedback.
All reactions