toasty_core/schema/app/field/
primitive.rs

1use crate::{schema::db, stmt};
2
3/// The serialization format used to store a field value.
4#[derive(Debug, Clone)]
5pub enum SerializeFormat {
6    /// Serialize as JSON using serde_json.
7    Json,
8}
9
10#[derive(Debug, Clone)]
11pub struct FieldPrimitive {
12    /// The field's primitive type
13    pub ty: stmt::Type,
14
15    /// The database storage type of the field.
16    ///
17    /// This is specified as a hint.
18    pub storage_ty: Option<db::Type>,
19
20    /// If set, the field value is serialized using the specified format
21    /// before being stored in the database.
22    pub serialize: Option<SerializeFormat>,
23}