Skip to content

Commit c0564bd

Browse files
committed
db: cleanup transaction implementation and stabilize connection pool
- Make Transaction fully header-only (remove src/Transaction.cpp) - Update ConnectionPool implementation for ORM compatibility - Align CMakeLists with header-only DB primitives
1 parent 355d23f commit c0564bd

3 files changed

Lines changed: 3 additions & 15 deletions

File tree

CMakeLists.txt

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -218,14 +218,12 @@ set(VIX_DB_PUBLIC_HEADERS
218218

219219
set(VIX_DB_SOURCES
220220
src/pool/ConnectionPool.cpp
221-
src/Transaction.cpp
222221
src/Database.cpp
223222
src/mig/MigrationsRunner.cpp
224223
src/mig/FileMigrationsRunner.cpp
225224
src/Sha256.cpp
226225
)
227226

228-
229227
# MySQL driver sources
230228
if (VIX_DB_HAS_MYSQL)
231229
list(APPEND VIX_DB_PUBLIC_HEADERS include/vix/db/drivers/mysql/MySQLDriver.hpp)

src/Transaction.cpp

Lines changed: 0 additions & 13 deletions
This file was deleted.

src/pool/ConnectionPool.cpp

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -75,6 +75,9 @@ namespace vix::db
7575
for (std::size_t i = 0; i < cfg_.min; ++i)
7676
{
7777
auto c = factory_();
78+
if (!c || !c->ping())
79+
throw DBError("ConnectionPool::warmup: factory returned invalid connection");
80+
7881
idle_.push(std::move(c));
7982
++total_;
8083
}

0 commit comments

Comments
 (0)