38 lines
653 B
C++
38 lines
653 B
C++
#ifndef QUERY_QUERY_COMPILER_HPP
|
|
#define QUERY_QUERY_COMPILER_HPP
|
|
|
|
#include "matador/query/query_part_visitor.hpp"
|
|
#include "matador/query/query_parts.hpp"
|
|
|
|
|
|
#include <typeindex>
|
|
#include <string>
|
|
|
|
namespace matador::sql {
|
|
class dialect;
|
|
}
|
|
|
|
namespace matador::query {
|
|
|
|
struct query_data;
|
|
|
|
class query_compiler : public query_part_visitor
|
|
{
|
|
public:
|
|
explicit query_compiler(sql::dialect& d);
|
|
|
|
std::string compile(const query_data *data);
|
|
|
|
private:
|
|
void visit(query_select_part &select_part) override;
|
|
void visit(query_from_part &from_part) override;
|
|
|
|
private:
|
|
sql::dialect &dialect_;
|
|
std::string sql_;
|
|
};
|
|
|
|
}
|
|
|
|
#endif //QUERY_QUERY_COMPILER_HPP
|