35 lines
895 B
C++
35 lines
895 B
C++
#include <catch2/catch_test_macros.hpp>
|
|
|
|
#include "matador/sql/connection_info.hpp"
|
|
#include "matador/sql/connection_pool.hpp"
|
|
#include "matador/orm/session.hpp"
|
|
|
|
// #include "matador/sql/statement_cache.hpp"
|
|
|
|
#include "connection.hpp"
|
|
#include "matador/sql/dialect_builder.hpp"
|
|
|
|
using namespace matador;
|
|
|
|
class StatementCacheFixture
|
|
{
|
|
public:
|
|
StatementCacheFixture()
|
|
: pool(test::connection::dns, 4), ses(pool)
|
|
{}
|
|
~StatementCacheFixture() = default;
|
|
|
|
protected:
|
|
sql::connection_pool<sql::connection> pool;
|
|
orm::session ses;
|
|
};
|
|
|
|
TEST_CASE_METHOD(StatementCacheFixture, "Acquire prepared statement", "[statement cache]") {
|
|
// const auto d = sql::dialect_builder::builder().create().build();
|
|
// sql::statement_cache cache(pool, d);
|
|
|
|
// auto conn = pool.acquire();
|
|
|
|
std::string sql = R"(SELECT * FROM person WHERE name = 'george')";
|
|
// auto &stmt = cache.acquire(sql, *conn);
|
|
} |