a bit of further work
This commit is contained in:
24
main.cpp
24
main.cpp
@@ -11,16 +11,22 @@ int main(int argc, char *argv[]) {
|
||||
Parser parser{};
|
||||
Executor executor{};
|
||||
|
||||
std::string sql_create = "create table a (i integer not null, s varchar(64), f float)";
|
||||
// std::string sql_insert = "insert into a (i, s) values(1, 'one')";
|
||||
// std::string sql_inser2 = "insert into a (i, s) values(2, 'two')";
|
||||
// std::string sql_inser3 = "insert into a (i, s) values(3, 'two')";
|
||||
// std::string sql_update = "update a set s = 'three' where i = 3";
|
||||
// std::string sql_select = "select i, s from a where i > 0";
|
||||
// std::string sql_delete = "delete from a where i = 3";
|
||||
std::vector<std::string> sql_commands {
|
||||
"create table a (i integer not null, s varchar(64), f float null)",
|
||||
"insert into a (i, s) values(1, 'one')",
|
||||
"insert into a (i, s) values(2, 'two')",
|
||||
"insert into a (i, s) values(3, 'two')",
|
||||
"select i, s from a where i > 0"
|
||||
// "update a set s = 'three' where i = 3"
|
||||
// "delete from a where i = 3"
|
||||
// "select i, s from a where i > 0"
|
||||
};
|
||||
|
||||
auto node = parser.parse(sql_create);
|
||||
|
||||
executor.execute(*node.get());
|
||||
for(auto command : sql_commands) {
|
||||
auto node = parser.parse(command);
|
||||
executor.execute(*node.get());
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user