1#ifndef QUERY_STATEMENT_H
2#define QUERY_STATEMENT_H
42 struct BinaryExpression;
51 std::unique_ptr<BinaryExpression>
binary;
63 std::unique_ptr<Expression>
left;
65 std::unique_ptr<Expression>
right;
68 BinaryExpression(std::unique_ptr<Expression> l, std::string operation, std::unique_ptr<Expression> r)
69 :
left(std::move(l)),
op(std::move(operation)),
right(std::move(r)) {}
Definition BasicParser.h:16
StatementType
Types of SQL statements.
Definition Statement.h:15
@ Update
Definition Statement.h:18
@ Drop
Definition Statement.h:21
@ List
Definition Statement.h:22
@ Create
Definition Statement.h:20
@ Unknown
Definition Statement.h:23
@ Insert
Definition Statement.h:17
@ Select
Definition Statement.h:16
@ Delete
Definition Statement.h:19
ExpressionType
Types of expression nodes.
Definition Statement.h:30
@ Identifier
Definition Statement.h:31
@ StringLiteral
Definition Statement.h:32
@ BinaryOp
Definition Statement.h:34
@ NumericLiteral
Definition Statement.h:33
@ Wildcard
Definition Statement.h:35
BinaryExpression()=default
std::unique_ptr< Expression > right
Definition Statement.h:65
BinaryExpression(std::unique_ptr< Expression > l, std::string operation, std::unique_ptr< Expression > r)
Definition Statement.h:68
std::string op
Definition Statement.h:64
std::unique_ptr< Expression > left
Definition Statement.h:63
std::string name
Definition Statement.h:147
bool isPrimaryKey
Definition Statement.h:149
std::string type
Definition Statement.h:148
ColumnDefinitionStmt()
Definition Statement.h:151
ColumnDefinitionStmt(std::string n, std::string t, bool pk=false)
Definition Statement.h:152
std::vector< ColumnDefinitionStmt > columns
Definition Statement.h:162
std::string tableName
Definition Statement.h:161
CreateStatement()
Definition Statement.h:164
std::unique_ptr< WhereClause > where
Definition Statement.h:137
DeleteStatement()
Definition Statement.h:139
std::string tableName
Definition Statement.h:136
DropStatement()
Definition Statement.h:174
std::string tableName
Definition Statement.h:172
Expression()
Definition Statement.h:53
Expression(ExpressionType t, std::string val="")
Definition Statement.h:54
std::unique_ptr< BinaryExpression > binary
Definition Statement.h:51
ExpressionType type
Definition Statement.h:49
std::string value
Definition Statement.h:50
InsertStatement()
Definition Statement.h:116
std::vector< std::string > columns
Definition Statement.h:113
std::vector< Expression > values
Definition Statement.h:114
std::string tableName
Definition Statement.h:112
ListStatement()
Definition Statement.h:183
std::vector< Expression > columns
Definition Statement.h:100
SelectStatement()
Definition Statement.h:104
std::unique_ptr< WhereClause > where
Definition Statement.h:102
std::string tableName
Definition Statement.h:101
Statement(StatementType t)
Definition Statement.h:91
StatementType type
Definition Statement.h:89
virtual ~Statement()=default
std::string tableName
Definition Statement.h:124
std::unique_ptr< WhereClause > where
Definition Statement.h:126
std::vector< std::pair< std::string, Expression > > assignments
Definition Statement.h:125
UpdateStatement()
Definition Statement.h:128
WhereClause(std::unique_ptr< Expression > cond)
Definition Statement.h:80
std::unique_ptr< Expression > condition
Definition Statement.h:77