#ifndef QUERY_STATEMENT_CACHE_HPP #define QUERY_STATEMENT_CACHE_HPP #include "matador/sql/statement.hpp" #include #include #include #include namespace matador::sql { class connection; struct cache_info { statement statement_; // std::unique_ptr statement_; size_t connection_id_; }; class statement_cache { public: statement& acquire(query_context &&context, const connection &conn); void release(const statement &stmt); private: mutable std::mutex mutex_; size_t max_cache_size_{256}; std::hash hash_; using statement_map = std::unordered_map; statement_map statement_map_; }; } #endif //QUERY_STATEMENT_CACHE_HPP