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
If you need your JSON field to be deserialized into a struct. You would need to derive FromJsonQueryResult for it.
#[derive(Clone,Debug,PartialEq,Eq,DeriveEntityModel)]#[sea_orm(table_name = "json_struct")]pubstructModel{#[sea_orm(primary_key)]pubid:i32,// JSON column defined in `serde_json::Value`pubjson:Json,// JSON column defined in custom structpubjson_value:KeyValue,pubjson_value_opt:Option<KeyValue>,}// The custom struct must derive `FromJsonQueryResult`, `Serialize` and `Deserialize`#[derive(Clone,Debug,PartialEq,Eq,Serialize,Deserialize,FromJsonQueryResult)]pubstructKeyValue{pubid:i32,pubname:String,pubprice:f32,pubnotes:Option<String>,}
The text was updated successfully, but these errors were encountered:
Under this section, the following example fails to compile because
f32
does not implementEq
:https://www.sea-ql.org/SeaORM/docs/generate-entity/entity-structure/#column-type
The text was updated successfully, but these errors were encountered: