moved parameter_binder from member to parameter to bind, execute and fetch methods

This commit is contained in:
2025-07-30 21:00:40 +02:00
parent ebd8bccfb3
commit 6e2baad3ef
18 changed files with 169 additions and 168 deletions
@@ -2,8 +2,7 @@
#define QUERY_POSTGRES_STATEMENT_HPP
#include "matador/sql/interface/statement_impl.hpp"
#include "postgres_parameter_binder.h"
#include "matador/sql/interface/parameter_binder.hpp"
#include <libpq-fe.h>
@@ -14,18 +13,17 @@ class postgres_statement final : public sql::statement_impl
public:
postgres_statement(PGconn *db, std::string name, const sql::query_context &query);
utils::result<size_t, utils::error> execute() override;
utils::result<std::unique_ptr<sql::query_result_impl>, utils::error> fetch() override;
utils::result<size_t, utils::error> execute(const sql::interface::parameter_binder& bindings) override;
utils::result<std::unique_ptr<sql::query_result_impl>, utils::error> fetch(const sql::interface::parameter_binder& bindings) override;
void reset() override;
protected:
utils::attribute_writer& binder() override;
[[nodiscard]] std::unique_ptr<utils::attribute_writer> create_binder() const override;
private:
PGconn *db_{nullptr};
std::string name_;
postgres_parameter_binder binder_;
};
}