From ed6140f879d8eb78de15c108dd25266b569c3f29 Mon Sep 17 00:00:00 2001 From: Arek W Date: Wed, 5 Mar 2014 19:36:15 +1100 Subject: [PATCH] Fix sqlite+windows connection issue. Allows passing object with connection details on windows without a host. Closes #461 --- lib/Drivers/DML/sqlite.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/Drivers/DML/sqlite.js b/lib/Drivers/DML/sqlite.js index e0e54626..63b6a043 100644 --- a/lib/Drivers/DML/sqlite.js +++ b/lib/Drivers/DML/sqlite.js @@ -25,7 +25,7 @@ function Driver(config, connection, opts) { // on Windows, paths have a drive letter which is parsed by // url.parse() as the hostname. If host is defined, assume // it's the drive letter and add ":" - if (process.platform == "win32" && config.host.match(/^[a-z]$/i)) { + if (process.platform == "win32" && config.host && config.host.match(/^[a-z]$/i)) { this.db = new sqlite3.Database(((config.host ? config.host + ":" : "") + (config.pathname || "")) || ':memory:'); } else { this.db = new sqlite3.Database(((config.host ? config.host : "") + (config.pathname || "")) || ':memory:');