fix: remove extra options to mysql2 pool
Signed-off-by: Muhammad Aaqil <aaqilcs102@gmail.com>
This commit is contained in:
parent
be9c2f173c
commit
dcea851121
27
lib/mysql.js
27
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) {
|
||||
|
|
Loading…
Reference in New Issue