#ifndef QUERY_QUERY_DATA_HPP #define QUERY_QUERY_DATA_HPP #include "matador/object/attribute.hpp" #include "matador/sql/resolver_service.hpp" #include "matador/utils/types.hpp" namespace matador::sql { enum class sql_command { Unknown, Create, CreateTable, CreateSchema, CreateSequence, CreateDatabase, Update, Insert, Delete, Select, Drop, DropTable, DropSchema, DropSequence, DropDatabase, Alter, AlterTable, AlterSchema }; struct query_context { std::string sql; size_t sql_hash{}; sql_command command{}; std::string command_name{}; std::string schema_name{}; std::string table_name{}; std::vector prototype{}; std::vector bind_vars{}; std::vector bind_types{}; // Data for resolving query result std::shared_ptr resolver{}; std::type_index result_type = typeid(void); [[nodiscard]] bool is_ddl() const { return command == sql_command::Create || command == sql_command::Alter; } [[nodiscard]] bool is_dml() const { return command == sql_command::Insert || command == sql_command::Update || command == sql_command::Delete; } [[nodiscard]] bool is_query() const { return command == sql_command::Select; } }; } #endif //QUERY_QUERY_DATA_HPP