microsoft / go-sqlcmd

The new sqlcmd, CLI for SQL Server and Azure SQL (winget install sqlcmd / sqlcmd create mssql / sqlcmd open ads)
https://learn.microsoft.com/sql/tools/sqlcmd/go-sqlcmd-utility
MIT License
393 stars 62 forks source link

Use a Uri package to build SQL Connection strings #265

Open stuartpa opened 1 year ago

stuartpa commented 1 year ago

Right now

sqlcmd config connection-strings

is using sprintf to build the connection strings. This probably doesn't do escaping correctly in all situations.

Rewrite this code to use a Uri build for each connection string, which will ensure all values are correctly escaped.