feat: Add path to socket for external mariadb database (#6670)

Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
Co-authored-by: Frank Elsinga <frank@elsinga.de>
This commit is contained in:
Diego
2026-01-18 16:44:43 +01:00
committed by GitHub
co-authored by autofix-ci[bot] Frank Elsinga
parent 999c09d818
commit a86789be6c
4 changed files with 36 additions and 13 deletions
+4 -2
View File
@@ -165,7 +165,7 @@ class Database {
* Read the database config
* @throws {Error} If the config is invalid
* @typedef {string|undefined} envString
* @returns {{type: "sqlite"} | {type:envString, hostname:envString, port:envString, database:envString, username:envString, password:envString}} Database config
* @returns {{type: "sqlite"} | {type:envString, hostname:envString, port:envString, database:envString, username:envString, password:envString, socketPath:envString}} Database config
*/
static readDBConfig() {
let dbConfig;
@@ -185,7 +185,7 @@ class Database {
/**
* @typedef {string|undefined} envString
* @param {{type: "sqlite"} | {type:envString, hostname:envString, port:envString, database:envString, username:envString, password:envString}} dbConfig the database configuration that should be written
* @param {{type: "sqlite"} | {type:envString, hostname:envString, port:envString, database:envString, username:envString, password:envString, socketPath:envString}} dbConfig the database configuration that should be written
* @returns {void}
*/
static writeDBConfig(dbConfig) {
@@ -284,6 +284,7 @@ class Database {
port: dbConfig.port,
user: dbConfig.username,
password: dbConfig.password,
socketPath: dbConfig.socketPath,
...(dbConfig.ssl
? {
ssl: {
@@ -309,6 +310,7 @@ class Database {
user: dbConfig.username,
password: dbConfig.password,
database: dbConfig.dbName,
socketPath: dbConfig.socketPath,
timezone: "Z",
typeCast: function (field, next) {
if (field.type === "DATETIME") {