initial matador ng commit

This commit is contained in:
2025-02-02 20:37:12 +01:00
parent 19de5714f4
commit ded3daceb3
378 changed files with 14913 additions and 13431 deletions
-37
View File
@@ -1,37 +0,0 @@
#ifndef QUERY_STATEMENT_CACHE_HPP
#define QUERY_STATEMENT_CACHE_HPP
#include "matador/sql/statement.hpp"
#include <memory>
#include <mutex>
#include <string>
#include <unordered_map>
namespace matador::sql {
class connection;
struct cache_info
{
statement statement_;
// std::unique_ptr<statement> 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<std::string> hash_;
using statement_map = std::unordered_map<size_t, cache_info>;
statement_map statement_map_;
};
}
#endif //QUERY_STATEMENT_CACHE_HPP