ensure proper table creation in session::create_schema including foreign key constraints

This commit is contained in:
Sascha Kühl
2025-07-17 15:56:15 +02:00
parent 581b93c5ea
commit fa393a1e30
16 changed files with 186 additions and 221 deletions
+20 -10
View File
@@ -9,18 +9,26 @@
namespace matador::sql {
enum class sql_command {
SQL_CMD_UNKNOWN,
SQL_CMD_CREATE,
SQL_CMD_UPDATE,
SQL_CMD_INSERT,
SQL_CMD_DELETE,
SQL_CMD_SELECT,
SQL_CMD_DROP,
SQL_CMD_ALTER
SQL_UNKNOWN,
SQL_CREATE_TABLE,
SQL_CREATE_SCHEMA,
SQL_CREATE_DATABASE,
SQL_UPDATE,
SQL_INSERT,
SQL_DELETE,
SQL_SELECT,
SQL_DROP_TABLE,
SQL_DROP_SCHEMA,
SQL_DROP_DATABASE,
SQL_ALTER_TABLE
};
struct query_context
{
struct sql_command_info {
std::string sql;
sql_command command{};
};
struct query_context {
std::string sql;
sql_command command{};
std::string command_name;
@@ -32,6 +40,8 @@ struct query_context
std::unordered_map<std::string, std::string> column_aliases;
std::unordered_map<std::string, std::string> table_aliases;
std::vector<sql_command_info> additional_commands;
};
}