Skip to main content

cognee_database/entities/
pipeline_run_payload_field.rs

1//! SeaORM entity for the `pipeline_run_payload_fields` table.
2//!
3//! Backs the DB-backed default accumulator for pipeline payload events
4//! (LIB-06). Composite primary key on `(pipeline_run_id, key)` — concurrent
5//! inserts with the same key upsert (last-write-wins per row); inserts with
6//! different keys do not contend.
7
8use sea_orm::entity::prelude::*;
9use serde::{Deserialize, Serialize};
10
11#[derive(Clone, Debug, PartialEq, Eq, DeriveEntityModel, Serialize, Deserialize)]
12#[sea_orm(table_name = "pipeline_run_payload_fields")]
13pub struct Model {
14    /// Random per-invocation run id (matches
15    /// `cognee_core::PipelineRunInfo.run_id`) stored as a string for
16    /// cross-DB portability.
17    #[sea_orm(primary_key, auto_increment = false)]
18    pub pipeline_run_id: String,
19    #[sea_orm(primary_key, auto_increment = false)]
20    pub key: String,
21    #[sea_orm(column_type = "Json")]
22    pub value: Json,
23    pub created_at: DateTimeUtc,
24    pub updated_at: DateTimeUtc,
25}
26
27#[derive(Copy, Clone, Debug, EnumIter, DeriveRelation)]
28pub enum Relation {}
29
30impl ActiveModelBehavior for ActiveModel {}