toasty_sql/stmt/
column_def.rs1use toasty_core::{
2 driver,
3 schema::db::{self, Column},
4};
5
6#[derive(Debug, Clone)]
8pub struct ColumnDef {
9 pub name: String,
11 pub ty: db::Type,
13 pub not_null: bool,
15 pub auto_increment: bool,
17}
18
19impl ColumnDef {
20 pub(crate) fn from_schema(column: &Column, _storage_types: &driver::StorageTypes) -> Self {
21 Self {
22 name: column.name.clone(),
23 ty: column.storage_ty.clone(),
24 not_null: !column.nullable,
25 auto_increment: column.auto_increment,
26 }
27 }
28}