A SQL Server named instance (host\INSTANCE) is the default install shape on Windows, and it cannot be expressed in the mssql:// URL form the CLI documents: new URL() rejects \ as a host character, so the CLI dies with a bare "Invalid URL" and no hint about what to do instead.
Reproduction
$ owlsql generate --url "mssql://sa:pass@localhost\SQLEXPRESS/db"
Error: Invalid URL
mssqlUrlToConfig('mssql://sa:pass@localhost\\SQLEXPRESS/db') // throws TypeError: Invalid URL
mssqlUrlToConfig('mssql://sa:p%40ss@localhost:1433/db') // ok
The ADO form does work (--url "Server=localhost\SQLEXPRESS;Database=db;User Id=sa;Password=pass" → ADO_MSSQL_PATTERN routes it to mssql and the string is handed to mssql.connect untouched), so this is a discoverability problem more than a missing capability.
Suggestions
- Catch the
new URL failure in mssqlUrlToConfig and rethrow with the redacted URL plus the ADO alternative, the way unrecognizedUrlError already does for other bad URLs.
- Optionally support the shape directly by splitting
host\instance before parsing and emitting options.instanceName (node-mssql's own config field for it).
- Either way, mention named instances in the
--url row of the CLI table in the README.
Found in an audit of master @ dc1afdb (v0.1.8).
A SQL Server named instance (
host\INSTANCE) is the default install shape on Windows, and it cannot be expressed in themssql://URL form the CLI documents:new URL()rejects\as a host character, so the CLI dies with a bare "Invalid URL" and no hint about what to do instead.Reproduction
The ADO form does work (
--url "Server=localhost\SQLEXPRESS;Database=db;User Id=sa;Password=pass"→ADO_MSSQL_PATTERNroutes it to mssql and the string is handed tomssql.connectuntouched), so this is a discoverability problem more than a missing capability.Suggestions
new URLfailure inmssqlUrlToConfigand rethrow with the redacted URL plus the ADO alternative, the wayunrecognizedUrlErroralready does for other bad URLs.host\instancebefore parsing and emittingoptions.instanceName(node-mssql's own config field for it).--urlrow of the CLI table in the README.Found in an audit of
master@ dc1afdb (v0.1.8).