use serde::{Deserialize, Serialize}; use surrealdb::sql::{Id, Thing}; use crate::model::Model; #[derive(Debug, Deserialize, Serialize)] pub struct |TableNamePascal||ModelNamePascal| { pub id: Option, pub value: String, } impl Model for |TableNamePascal||ModelNamePascal| { const TABLE: &'static str = "|table_name_snake|"; const ENTITY: Option<&'static str> = Some("|model_name_snake|"); fn get_id(&self) -> Option { if let Some(thing) = &self.id { Some(thing.id.clone()) } else { None } } }