use indexmap::IndexMap;
use crate::span::{Span, Spanned};
#[derive(Debug, Clone, PartialEq, Eq)]
pub struct Table {
pub name: Spanned<String>,
pub if_not_exists: bool,
pub columns: IndexMap<String, Column>,
pub primary_key: Option<PrimaryKey>,
pub indexes: Vec<Index>,
pub span: Span,
}
#[derive(Debug, Clone, PartialEq, Eq)]
pub struct Column {
pub r#type: Spanned<String>,
pub null: bool,
pub default: Option<String>,
pub span: Span,
}
#[derive(Debug, Clone, PartialEq, Eq)]
pub struct PrimaryKey {
pub name: Option<String>,
pub columns: Vec<String>,
pub span: Span,
}
#[derive(Debug, Clone, PartialEq, Eq)]
pub struct Index {
pub name: String,
pub columns: Vec<String>,
pub unique: bool,
pub using: Option<String>,
pub r#where: Option<String>,
pub span: Span,
}