refactor(pool): permit extra user and password aliases

This commit is contained in:
Linden committed 2021-11-15 09:09:52 +11:00
1 parent 647243f1cf
commit b004ec943d
1 file changed
+4 -3
+4 -3
View File
@@ -22,15 +22,16 @@ const parseSemiColons = () => {
}, {});
};
// @TODO: refactor acceptable options when using semicolon connection; this or stuff is getting old
const createConnection = () => {
if (connectionString.includes('database=')) {
if (connectionString.includes('host=')) {
const options = parseSemiColons();
return createPool({
host: options.host || 'localhost',
port: options.port || 3306,
user: options.username || options.user || options.userid || 'root',
password: options.password || options.pass || '',
user: options.username || options.user || options.userid || options.uid || 'root',
password: options.password || options.pass || options.pwd || '',
database: options.endpoint || options.database,
charset: 'utf8mb4_unicode_ci',
connectTimeout: 30000,