50 lines
1.0 KiB
C++
50 lines
1.0 KiB
C++
#ifndef QUERY_QUERY_DATA_HPP
|
|
#define QUERY_QUERY_DATA_HPP
|
|
|
|
#include "matador/object/attribute_definition.hpp"
|
|
#include "matador/sql/table.hpp"
|
|
|
|
#include "matador/utils/types.hpp"
|
|
|
|
namespace matador::sql {
|
|
|
|
enum class sql_command {
|
|
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 sql_command_info {
|
|
std::string sql;
|
|
sql_command command{};
|
|
};
|
|
|
|
struct query_context {
|
|
std::string sql;
|
|
sql_command command{};
|
|
std::string command_name;
|
|
sql::table table{""};
|
|
std::vector<object::attribute_definition> prototype;
|
|
std::vector<std::string> result_vars;
|
|
std::vector<std::string> bind_vars;
|
|
std::vector<utils::database_type> bind_types;
|
|
|
|
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;
|
|
};
|
|
|
|
}
|
|
|
|
#endif //QUERY_QUERY_DATA_HPP
|