feat: add MariaDB schema and connection pool

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
This commit is contained in:
2026-07-29 14:09:46 +02:00
co-authored by Claude Sonnet 5
parent 378ca762a2
commit a5ab05303f
3 changed files with 68 additions and 0 deletions
+23
View File
@@ -0,0 +1,23 @@
import mariadb from 'mariadb';
let pool;
export function getPool(config) {
if (!pool) {
pool = mariadb.createPool({
host: config.db.host,
user: config.db.user,
password: config.db.password,
database: config.db.database,
connectionLimit: 10,
});
}
return pool;
}
export async function closePool() {
if (pool) {
await pool.end();
pool = undefined;
}
}