mikeobrien / node-sqlcmd-runner

Node.js wrapper for sqlcmd.
MIT License
6 stars 4 forks source link

Cannot run in OSX #2

Open prajankya opened 5 years ago

prajankya commented 5 years ago

When I run it on OSX, I get

Exit code: 1
(node:33521) UnhandledPromiseRejectionWarning: Error: sqlcmd failed:

Sqlcmd: '\...\database_structure\master.sql': Invalid filename.

Obviously the forward slash vs backslash issue, after seeing your source code, I found the culprit as toWindowsPath function.

Please update the source code to support unix paths as well.

tracker1 commented 4 years ago

SQLCMD cannot install in OSX... if you have Docker Desktop for Mac installed, you can give mine a shot.

https://github.com/tracker1/node-ms-sqlcmd

tracker1 commented 4 years ago

Also, you can alias sqlcmd=docker exec -i YOURSQLCONTAINER /opt/mssql-tools/bin/sqlcmd or create a sqlcmd script in bin with the above sequence.

Though, the variable options won't work right, I accounted for this above, but this module it's unlikely.