pub use drizzle_types::sqlite::ddl::*;
#[derive(Debug, Clone, Default)]
pub struct ParsedTable {
pub strict: bool,
pub without_rowid: bool,
pub uniques: Vec<ParsedUnique>,
}
#[must_use]
pub fn parse_table_ddl(sql: &str) -> ParsedTable {
let (strict, without_rowid) = crate::sqlite::introspect::parse_table_options(sql);
ParsedTable {
strict,
without_rowid,
uniques: Vec::new(), }
}
#[derive(Debug, Clone)]
pub struct ParsedGenerated {
pub expression: String,
pub gen_type: GeneratedType,
}
#[derive(Debug, Clone)]
pub struct ParsedUnique {
pub name: Option<String>,
pub columns: Vec<String>,
}
#[derive(Debug, Clone)]
pub struct ParsedForeignKey {
pub name: Option<String>,
pub columns: Vec<String>,
pub table_to: String,
pub columns_to: Vec<String>,
pub on_delete: Option<String>,
pub on_update: Option<String>,
}
#[derive(Debug, Clone)]
pub struct ParsedPrimaryKey {
pub columns: Vec<String>,
pub autoincrement: bool,
}
#[derive(Debug, Clone)]
pub struct ParsedCheck {
pub name: Option<String>,
pub expression: String,
}