From 8f62b08e70fc33e5eec9e05ec942830445c70a60 Mon Sep 17 00:00:00 2001 From: Raymond Feng Date: Fri, 15 Aug 2014 16:27:12 -0700 Subject: [PATCH] Allow properties to pass through mysql driver See https://github.com/strongloop/loopback-connector-mysql/issues/46 --- lib/mysql.js | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/lib/mysql.js b/lib/mysql.js index 32b6f99..f72c72c 100644 --- a/lib/mysql.js +++ b/lib/mysql.js @@ -54,6 +54,14 @@ exports.initialize = function initializeDataSource(dataSource, callback) { options.database = s.database; } + // Take other options for mysql driver + // See https://github.com/strongloop/loopback-connector-mysql/issues/46 + for (var p in s) { + if (options[p] === undefined) { + options[p] = s[p]; + } + } + dataSource.client = mysql.createPool(options); dataSource.client.on('error', function (err) {