sea-orm icon indicating copy to clipboard operation
sea-orm copied to clipboard

Json field to support BTreeMap and HashMap

Open kudlatyamroth opened this issue 1 year ago • 2 comments

Discussed in https://github.com/SeaQL/sea-orm/discussions/2356

Originally posted by kudlatyamroth September 13, 2024 I have struct like this:

#[derive(Clone, Debug, PartialEq, Eq, Serialize, Deserialize, FromJsonQueryResult)]
pub struct Component {
    base_price: Decimal,
    component_type: String,
}

#[derive(Clone, Debug, PartialEq, DeriveEntityModel, Eq)]
#[sea_orm(table_name = "product")]
pub struct Model {
    #[sea_orm(primary_key, auto_increment = false)]
    pub id: Uuid,
    pub name: String,
    pub component_list: BTreeMap<String, Component>,
}

as of now it says i need to implement TryGetable

kudlatyamroth avatar Sep 13 '24 12:09 kudlatyamroth

Hi @Huliiiiii May I take this one?

denyszhak avatar Nov 22 '25 12:11 denyszhak

@denyszhak Sorry for the late reply, of course.

Huliiiiii avatar Nov 28 '25 14:11 Huliiiiii