From 720b701fac13f464addb2116301d9a9a2998d041 Mon Sep 17 00:00:00 2001 From: Dan Goodliffe Date: Wed, 27 Aug 2025 20:48:27 +0100 Subject: Add MockDBPool Feels like this should be provided by libdbpp, but it isn't. --- test/test-util.cpp | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'test/test-util.cpp') diff --git a/test/test-util.cpp b/test/test-util.cpp index feb58c7..4648498 100644 --- a/test/test-util.cpp +++ b/test/test-util.cpp @@ -3,4 +3,12 @@ namespace WebStat { MockDB::MockDB() : DB::PluginMock("webstat", {SRC_DIR / "schema.sql"}, "user=postgres dbname=postgres") { } + + MockDBPool::MockDBPool(std::string name) : DB::BasicConnectionPool(1, 1), name {std::move(name)} { } + + DB::ConnectionPtr + MockDBPool::createResource() const + { + return DB::MockDatabase::openConnectionTo(name); + } } -- cgit v1.2.3