Skip to content

Commit

Permalink
Fix sqlite+windows connection issue.
Browse files Browse the repository at this point in the history
Allows passing object with connection details on windows without a host.
Closes #461
  • Loading branch information
dxg committed Mar 5, 2014
1 parent 264b5ba commit ed6140f
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lib/Drivers/DML/sqlite.js
Original file line number Diff line number Diff line change
Expand Up @@ -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:');
Expand Down

0 comments on commit ed6140f

Please sign in to comment.