mirror of
https://github.com/requarks/wiki.git
synced 2026-08-26 05:07:30 -05:00
feat: add support for database connection via socketPath when using mysql2 driver (#7839)
* Added support for database socketPath in configure file when using dbClient mysql2 (mysql or mariadb) * refactor: mysql dbConfig to conditionally set socketPath Updated database configuration to conditionally include socketPath from WIKI.config. * fix: socketPath assignment typo --------- Co-authored-by: Nicolas Giard <github@ngpixel.com>
This commit is contained in:
co-authored by
Nicolas Giard
parent
a02e0131c1
commit
5c80184a1d
@@ -91,6 +91,13 @@ module.exports = {
|
||||
dbConfig.ssl = sslOptions
|
||||
}
|
||||
|
||||
// Prune host and port if socketPath is configured
|
||||
if (WIKI.config.db.socketPath) {
|
||||
const { host, port, ...prunedConfig} = dbConfig
|
||||
dbConfig = prunedConfig
|
||||
dbConfig.socketPath = WIKI.config.db.socketPath.toString()
|
||||
}
|
||||
|
||||
// Fix mysql boolean handling...
|
||||
dbConfig.typeCast = (field, next) => {
|
||||
if (field.type === 'TINY' && field.length === 1) {
|
||||
|
||||
Reference in New Issue
Block a user