Skip to main content

cognee_database/entities/
notebook.rs

1//! SeaORM entity for the `notebooks` table.
2//!
3//! Stores per-user Jupyter-like notebooks with typed cells persisted as JSON.
4
5use sea_orm::entity::prelude::*;
6
7#[derive(Clone, Debug, PartialEq, Eq, DeriveEntityModel)]
8#[sea_orm(table_name = "notebooks")]
9pub struct Model {
10    /// UUID stored as hex string (matches the rest of the schema).
11    #[sea_orm(primary_key, auto_increment = false)]
12    pub id: String,
13    pub owner_id: String,
14    pub name: String,
15    /// JSON array of NotebookCell objects.
16    #[sea_orm(column_type = "Json")]
17    pub cells: serde_json::Value,
18    pub deletable: bool,
19    pub created_at: DateTimeUtc,
20}
21
22#[derive(Copy, Clone, Debug, EnumIter, DeriveRelation)]
23pub enum Relation {}
24
25impl ActiveModelBehavior for ActiveModel {}