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
Hi,
I will be great to have the support of the sql type DATE in the library.
I imagine this one will be done with chrono::NaiveDate since it's the one that is used in the documentation.
To give my own example, I have a model Rate which have a simple date:
use chrono::NaiveDate;use sea_orm::entity::prelude::*;use sea_orm::DeriveEntityModel;#[derive(Debug,Clone,PartialEq,DeriveEntityModel)]#[sea_orm(table_name = "currency_exchange_rate")]pubstructModel{#[sea_orm(primary_key)]pubcurrency_exchange_rate_id:i64,pubfrom_currency:String,pubto_currency:String,pubrate_date:NaiveDate,pubrate:f64,}#[derive(Copy,Clone,Debug,EnumIter,DeriveRelation)]pubenumRelation{}implActiveModelBehaviorforActiveModel{}
But this implementation give me a compile error:
error[E0277]: the trait bound `NaiveDate: TryGetable` is not satisfied
--> src/rates/mod.rs:11:35
|
11 | #[derive(Debug, Clone, PartialEq, DeriveEntityModel)]
| ^^^^^^^^^^^^^^^^^ the trait `TryGetable` is not implemented for `NaiveDate`
|
= note: this error originates in the derive macro `DeriveEntityModel` (in Nightly builds, run with -Z macro-backtrace for more info)
The text was updated successfully, but these errors were encountered:
Hi,
I will be great to have the support of the sql type
DATE
in the library.I imagine this one will be done with
chrono::NaiveDate
since it's the one that is used in the documentation.To give my own example, I have a model
Rate
which have a simple date:But this implementation give me a compile error:
The text was updated successfully, but these errors were encountered: