implemented the first version of statement_cache

This commit is contained in:
2025-07-30 10:34:33 +02:00
parent f90a670fb3
commit ebd8bccfb3
31 changed files with 575 additions and 278 deletions
+6 -4
View File
@@ -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_;