From 1756b1780a06fdc1f2df0b2610b3d5a920e8b93f Mon Sep 17 00:00:00 2001 From: "Navy.gif" Date: Tue, 15 Nov 2022 18:16:13 +0200 Subject: [PATCH] actually apply mariadb credentials --- src/server/database/MariaDB.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/server/database/MariaDB.js b/src/server/database/MariaDB.js index fd2f78f..ec53a28 100644 --- a/src/server/database/MariaDB.js +++ b/src/server/database/MariaDB.js @@ -11,6 +11,8 @@ class MariaDB { if (!config) Util.fatal(new Error('No config options provided!')); this.config = config; + const { MARIA_HOST: host, MARIA_USER: user, MARIA_PORT: port, MARIA_PASS: password, MARIA_DB: database } = config; + this._credentials = { host, user, port, password, database }; this.pool = null; this.ready = false; @@ -26,7 +28,7 @@ class MariaDB { init () { this.logger.status(`Creating connection pool`); - this.pool = mysql.createPool(this.config.options.client); + this.pool = mysql.createPool({ ...this.config.options.client, ...this._credentials }); this.pool.on('connection', (connection) => { this.logger.debug(`New connection: ${connection?.threadId || null}`);