lynx_core/entities/
response.rs

1//! `SeaORM` Entity, @generated by sea-orm-codegen 1.1.4
2
3use sea_orm::entity::prelude::*;
4use serde::{Deserialize, Serialize};
5
6#[derive(Clone, Debug, PartialEq, DeriveEntityModel, Eq, Serialize, Deserialize)]
7#[serde(rename_all = "camelCase")]
8#[sea_orm(table_name = "response")]
9pub struct Model {
10    #[sea_orm(primary_key)]
11    pub id: i32,
12    pub header: Json,
13    pub request_id: i32,
14    pub trace_id: String,
15    pub header_size: u32,
16}
17
18#[derive(Copy, Clone, Debug, EnumIter, DeriveRelation)]
19pub enum Relation {
20    #[sea_orm(
21        belongs_to = "super::request::Entity",
22        from = "Column::RequestId",
23        to = "super::request::Column::Id"
24    )]
25    Request,
26}
27
28// `Related` trait has to be implemented by hand
29impl Related<super::request::Entity> for Entity {
30    fn to() -> RelationDef {
31        Relation::Request.def()
32    }
33}
34
35impl ActiveModelBehavior for ActiveModel {}