query/include/matador/sql/query_context.hpp

40 lines
840 B
C++

#ifndef QUERY_QUERY_DATA_HPP
#define QUERY_QUERY_DATA_HPP
#include "matador/sql/column_definition.hpp"
#include "matador/sql/table.hpp"
#include "matador/utils/types.hpp"
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
};
struct query_context
{
std::string sql;
sql_command command{};
std::string command_name;
sql::table table{""};
std::vector<column_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;
};
}
#endif //QUERY_QUERY_DATA_HPP