Add buildDatabaseUrl and a CLI helper to print it

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
This commit is contained in:
2026-07-31 01:11:35 +02:00
co-authored by Claude Sonnet 5
parent 1ebff25603
commit 5e0b832fce
3 changed files with 28 additions and 1 deletions
+5
View File
@@ -2,6 +2,11 @@ import mariadb from 'mariadb';
let pool;
export function buildDatabaseUrl(config) {
const { host, user, password, database } = config.db;
return `mysql://${encodeURIComponent(user)}:${encodeURIComponent(password)}@${host}:3306/${database}?connection_limit=10`;
}
export function getPool(config) {
if (!pool) {
pool = mariadb.createPool({