#[cfg(feature = "with-serde")]
use serde::{Deserialize, Serialize};
use super::{NotNull, Type};
#[derive(Debug, Clone, PartialEq)]
#[cfg_attr(feature = "with-serde", derive(Serialize, Deserialize))]
pub struct ColumnInfo {
pub name: String,
pub col_type: ColumnType,
pub default: Option<ColumnExpression>,
pub generated: Option<ColumnExpression>,
pub not_null: Option<NotNull>,
pub is_identity: bool,
}
pub type ColumnType = Type;
#[derive(Debug, Clone, PartialEq)]
#[cfg_attr(feature = "with-serde", derive(Serialize, Deserialize))]
pub struct ColumnExpression(pub String);
impl ColumnExpression {
pub fn from_option_string(maybe_string: Option<String>) -> Option<ColumnExpression> {
maybe_string.map(ColumnExpression)
}
}