54 lines
1.1 KiB
C++
54 lines
1.1 KiB
C++
#ifndef QUERY_QUERY_DATA_HPP
|
|
#define QUERY_QUERY_DATA_HPP
|
|
|
|
#include "matador/object/attribute.hpp"
|
|
|
|
#include "matador/utils/types.hpp"
|
|
|
|
#include <unordered_map>
|
|
|
|
namespace matador::sql {
|
|
|
|
enum class sql_command {
|
|
SQL_UNKNOWN,
|
|
SQL_CREATE,
|
|
SQL_CREATE_TABLE,
|
|
SQL_CREATE_SCHEMA,
|
|
SQL_CREATE_DATABASE,
|
|
SQL_UPDATE,
|
|
SQL_INSERT,
|
|
SQL_DELETE,
|
|
SQL_SELECT,
|
|
SQL_DROP,
|
|
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{};
|
|
std::string schema_name{};
|
|
std::string table_name{};
|
|
std::vector<object::attribute> 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
|