mirror of
https://github.com/darksaid98/oxmysql.git
synced 2026-12-04 14:38:50 +00:00
refactor(pool): permit extra user and password aliases
This commit is contained in:
1 parent
647243f1cf
commit
b004ec943d
1 file changed
+4
-3
+4
-3
@@ -22,15 +22,16 @@ const parseSemiColons = () => {
|
|||||||
}, {});
|
}, {});
|
||||||
};
|
};
|
||||||
|
|
||||||
|
// @TODO: refactor acceptable options when using semicolon connection; this or stuff is getting old
|
||||||
const createConnection = () => {
|
const createConnection = () => {
|
||||||
if (connectionString.includes('database=')) {
|
if (connectionString.includes('host=')) {
|
||||||
const options = parseSemiColons();
|
const options = parseSemiColons();
|
||||||
|
|
||||||
return createPool({
|
return createPool({
|
||||||
host: options.host || 'localhost',
|
host: options.host || 'localhost',
|
||||||
port: options.port || 3306,
|
port: options.port || 3306,
|
||||||
user: options.username || options.user || options.userid || 'root',
|
user: options.username || options.user || options.userid || options.uid || 'root',
|
||||||
password: options.password || options.pass || '',
|
password: options.password || options.pass || options.pwd || '',
|
||||||
database: options.endpoint || options.database,
|
database: options.endpoint || options.database,
|
||||||
charset: 'utf8mb4_unicode_ci',
|
charset: 'utf8mb4_unicode_ci',
|
||||||
connectTimeout: 30000,
|
connectTimeout: 30000,
|
||||||
|
|||||||
Reference in new issue
Block a user