implemented the first version of statement_cache
This commit is contained in:
@@ -13,12 +13,10 @@
|
||||
namespace matador::sql {
|
||||
class connection_impl;
|
||||
|
||||
const auto null_logger = std::make_shared<null_sql_logger>();
|
||||
|
||||
/**
|
||||
* @brief The connection class represents a connection to a database.
|
||||
*/
|
||||
class connection final : public executor {
|
||||
class connection final : public executor, public prepared_executor {
|
||||
public:
|
||||
using logger_ptr = std::shared_ptr<abstract_sql_logger>;
|
||||
/**
|
||||
@@ -136,14 +134,18 @@ public:
|
||||
|
||||
[[nodiscard]] utils::result<std::unique_ptr<query_result_impl>, utils::error> fetch(const query_context &ctx) const override;
|
||||
[[nodiscard]] utils::result<size_t, utils::error> execute(const query_context &ctx) const override;
|
||||
[[nodiscard]] utils::result<statement, utils::error> prepare(const query_context &ctx) const override;
|
||||
[[nodiscard]] utils::result<statement, utils::error> prepare(const query_context &ctx) override;
|
||||
[[nodiscard]] std::string str( const query_context& ctx ) const override;
|
||||
|
||||
[[nodiscard]] const class dialect &dialect() const override;
|
||||
|
||||
private:
|
||||
[[nodiscard]] utils::result<std::unique_ptr<statement_impl>, utils::error> perform_prepare(const query_context &ctx) const;
|
||||
|
||||
private:
|
||||
friend class fetchable_query;
|
||||
friend class session;
|
||||
friend class statement_cache;
|
||||
|
||||
connection_info connection_info_;
|
||||
std::unique_ptr<connection_impl> connection_;
|
||||
|
||||
Reference in New Issue
Block a user