Skip to content

Commit

Permalink
refactor(pool): permit extra user and password aliases
Browse files Browse the repository at this point in the history
  • Loading branch information
thelindat committed Nov 14, 2021
1 parent 647243f commit b004ec9
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions src/pool.js
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down

0 comments on commit b004ec9

Please sign in to comment.