|
@@ -20,10 +20,10 @@ void process_sql(json& j) {
|
|
if (type == "create_stmt") {
|
|
if (type == "create_stmt") {
|
|
auto table_name = j["table_name"];
|
|
auto table_name = j["table_name"];
|
|
if (tables.exists(table_name)) {
|
|
if (tables.exists(table_name)) {
|
|
- throw std::runtime_error(
|
|
|
|
- fmt::format("table: `{}` exists\n", table_name));
|
|
|
|
|
|
+ fmt::print("error: table `{}` exists\n", table_name);
|
|
|
|
+ } else {
|
|
|
|
+ create_table(j["table_name"], j["cols"]);
|
|
}
|
|
}
|
|
- create_table(j["table_name"], j["cols"]);
|
|
|
|
} else {
|
|
} else {
|
|
throw std::runtime_error(
|
|
throw std::runtime_error(
|
|
fmt::format("Unknown expression type `{}` total: \n{}", type, j.dump(2)));
|
|
fmt::format("Unknown expression type `{}` total: \n{}", type, j.dump(2)));
|