#[derive(Debug, Clone, PartialEq, Eq)]
pub struct Column {
pub name: String,
pub physical_name: String,
pub deleted: bool,
pub default: Option<String>,
}
impl Column {
pub fn new(name: impl Into<String>) -> Self {
let name = name.into();
Self {
physical_name: name.clone(),
name,
deleted: false,
default: None,
}
}
pub fn backed_by(mut self, physical_name: impl Into<String>) -> Self {
self.physical_name = physical_name.into();
self
}
pub fn deleted(mut self) -> Self {
self.deleted = true;
self
}
pub fn with_default(mut self, default: impl Into<String>) -> Self {
self.default = Some(default.into());
self
}
}