microsoft / vscode-mssql

Visual Studio Code SQL Server extension.
Other
1.51k stars 448 forks source link

what URL format that mssql accepts to connect a sqlserver? #17915

Open yadongyaly opened 6 days ago

yadongyaly commented 6 days ago

Not a bug, I could not find an answer online so post my question here. I am working on TypeScript project, trying to use windows.open(URL, _self) to connect a database with VSC mssql extension, but I cannot find a correct URL format that mssql extension accepts.

For example, I tried this: const URL = vscode://ms-mssql.mssql//connect?server=${server}&database=${database}&authenticationType=AzureMFA; window.open(URL, "_self");

After running, the vscode app pops out a windows saying "do you want to open this URL with mssql extension, and I clicked yes. However, nothing happens after that.

There is an example of opening Azure Data Studio, it works well, I am looking for something similar with VSC mssql extension. const URL = azuredatastudio://openConnectionDialog?server=${server}&database=${database}&authenticationType=AzureMFA;

Charles-Gagnon commented 5 days ago

This extension doesn't currently support that, so unfortunately you won't be able to connect directly with a URI like you can in ADS

yadongyaly commented 5 days ago

Thanks @Charles-Gagnon for confirming this. I will look around for alternatives then