diff --git a/lib/mysql.js b/lib/mysql.js index 3b1551e..e8f7165 100644 --- a/lib/mysql.js +++ b/lib/mysql.js @@ -108,6 +108,28 @@ MySQL.prototype.connect = function(callback) { function generateOptions(settings) { const s = settings || {}; + const generatorSpecificOptions = [ + 'name', + 'connector', + 'sharedData', + 'forwardErrorToEnvironment', + 'skipLocalCache', + '_', + 'c', + 'y', + 'initialGenerator', + 'resolved', + 'namespace', + 'skip-cache', + 'skip-install', + 'force-install', + 'ask-answered', + 'config', + 'yes', + 'url', + 'engine', + 'collation', + ]; if (s.collation) { // Charset should be first 'chunk' of collation. s.charset = s.collation.substr(0, s.collation.indexOf('_')); @@ -148,7 +170,10 @@ function generateOptions(settings) { // Take other options for mysql driver // See https://github.com/loopbackio/loopback-connector-mysql/issues/46 for (const p in s) { - if (p === 'database' && s.createDatabase) { + if ( + (p === 'database' && s.createDatabase) || + generatorSpecificOptions.includes(p) + ) { continue; } if (options[p] === undefined) {