Skip to content

Commit

Permalink
Allow connectionString and options
Browse files Browse the repository at this point in the history
Currently there is no way for the user to specify
for example `typeCast` if we are using a connection string.
This makes it possible to specify a `connectionString`
option and then override options if needed
  • Loading branch information
mifi committed Dec 17, 2023
1 parent dc9c152 commit 0600829
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions lib/ConnectionConfig.js
Expand Up @@ -9,6 +9,10 @@ function ConnectionConfig(options) {
options = ConnectionConfig.parseUrl(options);
}

if (typeof options.connectionString === 'string') {
options = { ...ConnectionConfig.parseUrl(options.connectionString), ...options };
}

this.host = options.host || 'localhost';
this.port = options.port || 3306;
this.localAddress = options.localAddress;
Expand Down

0 comments on commit 0600829

Please sign in to comment.