feophantlib/engine/objects/
parse_tree.rs1use super::ParseExpression;
2
3#[derive(Clone, Debug)]
4pub enum ParseTree {
5 CreateTable(RawCreateTableCommand),
6 Insert(RawInsertCommand),
7 Select(RawSelectCommand),
8}
9
10#[derive(Clone, Debug)]
11pub struct RawCreateTableCommand {
12 pub table_name: String,
13 pub provided_columns: Vec<RawColumn>,
14}
15
16#[derive(Clone, Debug, PartialEq)]
17pub struct RawColumn {
18 pub name: String,
19 pub sql_type: String,
20 pub null: bool,
21 pub primary_key: bool,
22}
23
24#[derive(Clone, Debug, PartialEq)]
25pub struct RawInsertCommand {
26 pub table_name: String,
27 pub provided_columns: Option<Vec<String>>,
28 pub provided_values: Vec<ParseExpression>,
29}
30
31#[derive(Clone, Debug, PartialEq)]
33pub struct RawSelectCommand {
34 pub columns: Vec<String>,
35 pub table: String,
36}