create table as
This commit is contained in:
19
parser.h
19
parser.h
@@ -25,6 +25,7 @@ namespace usql {
|
||||
relational_operator,
|
||||
arithmetical_operator,
|
||||
create_table,
|
||||
create_table_as_select,
|
||||
insert_into,
|
||||
select_from,
|
||||
delete_from,
|
||||
@@ -63,13 +64,6 @@ namespace usql {
|
||||
null(nullable) {}
|
||||
};
|
||||
|
||||
struct ColValueNode : Node {
|
||||
std::string value;
|
||||
|
||||
ColValueNode(const std::string col_value) :
|
||||
Node(NodeType::column_value), value(col_value) {}
|
||||
};
|
||||
|
||||
struct FunctionNode : Node {
|
||||
std::string function;
|
||||
std::vector<std::unique_ptr<Node>> params;
|
||||
@@ -198,6 +192,7 @@ namespace usql {
|
||||
Node(NodeType::create_table), table_name(name), cols_defs(defs) {}
|
||||
};
|
||||
|
||||
|
||||
struct InsertIntoTableNode : Node {
|
||||
std::string table_name;
|
||||
std::vector<ColNameNode> cols_names;
|
||||
@@ -216,6 +211,16 @@ namespace usql {
|
||||
Node(NodeType::select_from), table_name(name), cols_names(names), where(std::move(where_clause)) {}
|
||||
};
|
||||
|
||||
|
||||
struct CreateTableAsSelectNode : Node {
|
||||
std::string table_name;
|
||||
std::unique_ptr<Node> select_table;
|
||||
|
||||
CreateTableAsSelectNode(const std::string name, std::unique_ptr<Node> table) :
|
||||
Node(NodeType::create_table_as_select), table_name(name), select_table(std::move(table)) {}
|
||||
};
|
||||
|
||||
|
||||
struct UpdateTableNode : Node {
|
||||
std::string table_name;
|
||||
std::vector<ColNameNode> cols_names;
|
||||
|
||||
Reference in New Issue
Block a user