Skip to content

Commit dcea851

Browse files
committed
fix: remove extra options to mysql2 pool
Signed-off-by: Muhammad Aaqil <[email protected]>
1 parent be9c2f1 commit dcea851

File tree

1 file changed

+26
-1
lines changed

1 file changed

+26
-1
lines changed

lib/mysql.js

Lines changed: 26 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -108,6 +108,28 @@ MySQL.prototype.connect = function(callback) {
108108

109109
function generateOptions(settings) {
110110
const s = settings || {};
111+
const generatorSpecificOptions = [
112+
'name',
113+
'connector',
114+
'sharedData',
115+
'forwardErrorToEnvironment',
116+
'skipLocalCache',
117+
'_',
118+
'c',
119+
'y',
120+
'initialGenerator',
121+
'resolved',
122+
'namespace',
123+
'skip-cache',
124+
'skip-install',
125+
'force-install',
126+
'ask-answered',
127+
'config',
128+
'yes',
129+
'url',
130+
'engine',
131+
'collation',
132+
];
111133
if (s.collation) {
112134
// Charset should be first 'chunk' of collation.
113135
s.charset = s.collation.substr(0, s.collation.indexOf('_'));
@@ -148,7 +170,10 @@ function generateOptions(settings) {
148170
// Take other options for mysql driver
149171
// See https://github.com/loopbackio/loopback-connector-mysql/issues/46
150172
for (const p in s) {
151-
if (p === 'database' && s.createDatabase) {
173+
if (
174+
(p === 'database' && s.createDatabase) ||
175+
generatorSpecificOptions.includes(p)
176+
) {
152177
continue;
153178
}
154179
if (options[p] === undefined) {

0 commit comments

Comments
 (0)