moved parameter_binder from member to parameter to bind, execute and fetch methods
This commit is contained in:
@@ -2,6 +2,7 @@
|
||||
#define STATEMENT_PROXY_HPP
|
||||
|
||||
#include "matador/sql/interface/statement_impl.hpp"
|
||||
#include "matador/sql/interface/parameter_binder.hpp"
|
||||
|
||||
namespace matador::sql {
|
||||
class statement_proxy {
|
||||
@@ -11,22 +12,24 @@ protected:
|
||||
public:
|
||||
virtual ~statement_proxy() = default;
|
||||
|
||||
virtual utils::result<size_t, utils::error> execute() = 0;
|
||||
virtual utils::result<std::unique_ptr<query_result_impl>, utils::error> fetch() = 0;
|
||||
virtual utils::result<size_t, utils::error> execute(interface::parameter_binder& bindings) = 0;
|
||||
virtual utils::result<std::unique_ptr<query_result_impl>, utils::error> fetch(interface::parameter_binder& bindings) = 0;
|
||||
|
||||
template<class Type>
|
||||
void bind(const Type &obj) {
|
||||
statement_->bind_object(obj);
|
||||
void bind(const Type &obj, const interface::parameter_binder& bindings) {
|
||||
statement_->bind_object(obj, bindings);
|
||||
}
|
||||
template<typename Type>
|
||||
void bind(size_t pos, Type &value) {
|
||||
statement_->bind(pos, value);
|
||||
void bind(size_t pos, Type &value, const interface::parameter_binder& bindings) {
|
||||
statement_->bind(pos, value, bindings);
|
||||
}
|
||||
void bind(size_t pos, const char *value, size_t size) const;
|
||||
void bind(size_t pos, std::string &val, size_t size) const;
|
||||
void bind(size_t pos, const char *value, size_t size, interface::parameter_binder& bindings) const;
|
||||
void bind(size_t pos, std::string &val, size_t size, interface::parameter_binder& bindings) const;
|
||||
|
||||
void reset() const;
|
||||
|
||||
[[nodiscard]] std::unique_ptr<utils::attribute_writer> create_binder() const;
|
||||
|
||||
protected:
|
||||
std::unique_ptr<statement_impl> statement_;
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user