From e1707ad2b3b33d72933194bd980f58821fce2cf7 Mon Sep 17 00:00:00 2001 From: Murali91 Date: Tue, 2 Apr 2019 16:03:19 -0700 Subject: [PATCH] option to provide dialect as a object to handle the browerify issue missing out the Dialects folder --- .gitignore | 3 +++ lib/Query.js | 2 +- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/.gitignore b/.gitignore index a58cf7a..7c8c3e6 100644 --- a/.gitignore +++ b/.gitignore @@ -3,3 +3,6 @@ .DS_Store node_modules test.js + +*.webstorm +.idea/ \ No newline at end of file diff --git a/lib/Query.js b/lib/Query.js index f8e9b6d..17cc462 100644 --- a/lib/Query.js +++ b/lib/Query.js @@ -21,7 +21,7 @@ function Query(opts) { opts = opts || {}; } - var Dialect = require("./Dialects/" + (opts.dialect || "mysql")); + var Dialect = typeof opts.dialect === 'object' ? opts.dialect : require("./Dialects/" + (opts.dialect || "mysql")); return { escape : Helpers.escapeQuery.bind(Helpers, Dialect),