feat: add default value for serde

This commit is contained in:
Namu
2026-04-02 00:30:40 +02:00
parent 91057c82ba
commit d6d709beac

View File

@@ -4,7 +4,9 @@ use crate::mappings::SQLiteDatatypes;
#[derive(Debug, Deserialize, Serialize, Default, Clone)]
pub struct Table {
pub name: String,
#[serde(default)]
pub columns: Vec<Column>,
#[serde(default)]
pub strict: bool
}
@@ -12,11 +14,17 @@ pub struct Table {
pub struct Column {
pub name: String,
pub datatype: SQLiteDatatypes,
#[serde(default)]
pub nullable: bool,
#[serde(default)]
pub default: Option<String>,
#[serde(default)]
pub auto_increment: bool,
#[serde(default)]
pub unique: bool,
#[serde(default)]
pub check_constraint: Option<String>, // raw check constraint
#[serde(default)]
pub primary_key: bool
}