another bit of refactoring

This commit is contained in:
2021-07-12 21:25:31 +02:00
parent 5e4480c767
commit eebfaacde4
10 changed files with 70 additions and 101 deletions

View File

@@ -1,5 +1,5 @@
#include "parser.h"
#include "executor.h"
#include "usql.h"
// https://dev.to/joaoh82/what-would-sqlite-look-like-if-written-in-rust-part-1-2np4
@@ -8,9 +8,6 @@
// drop table
int main(int argc, char *argv[]) {
usql::Parser parser{};
usql::Executor executor{};
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')",
@@ -35,13 +32,13 @@ int main(int argc, char *argv[]) {
};
usql::uSQL uSql{};
for (auto command : sql_commands) {
std::cout << command << std::endl;
auto node = parser.parse(command);
auto result = executor.execute(*node);
auto result = uSql.execute(command);
result->print();
// std::cout << std::endl;
}
return 0;