Skip to main content

sql_fun_sqlast/sem/parse_context/
table_info.rs

1use crate::sem::{AlterTable, AnalysisError, CreateTable, FullName};
2
3/// get table definition
4pub trait TableInfoRead {
5    /// get `CREATE TABLE` statement by `full_name`
6    fn get_table_impl(&self, key: &FullName) -> Option<&CreateTable>;
7}
8
9/// table information writer
10pub trait TableInfoWrite
11where
12    Self: Sized,
13{
14    /// apply `alter table` statement to current schema
15    fn apply_alter_table(self, alter_table: &AlterTable) -> Result<Self, AnalysisError>;
16
17    /// insert create table statement
18    fn insert_create_table(&mut self, name: &FullName, create_table: &CreateTable);
19}