query/include/matador/sql/internal/object_resolver_producer.hpp

31 lines
798 B
C++

#ifndef MATADOR_RESOLVER_PRODUCER_HPP
#define MATADOR_RESOLVER_PRODUCER_HPP
#include "matador/object/abstract_type_resolver.hpp"
#include "matador/sql/query_context.hpp"
#include "matador/utils/error.hpp"
#include "matador/utils/result.hpp"
#include <memory>
namespace matador::sql {
class dialect;
class statement;
class object_resolver_producer {
public:
virtual ~object_resolver_producer() = default;
virtual utils::result<query_context, utils::error> build_query(const dialect& d) = 0;
virtual std::shared_ptr<object::abstract_type_resolver> produce(statement&& stmt) = 0;
[[nodiscard]] const std::type_index& type() const;
protected:
explicit object_resolver_producer(const std::type_index &type);
private:
std::type_index type_;
};
}
#endif //MATADOR_RESOLVER_PRODUCER_HPP