How to programmatically connect a specific .sql file to a connection profile from another extension? #19696
Unanswered
EliothSinH
asked this question in
Q&A
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
❓ Question: How to programmatically connect a specific
.sql
file to a connection profile from another extension?Hi! I'm developing a custom VS Code extension that interacts with
.sql
files and uses thevscode-mssql
extension to run queries.My goal is to:
.sql
fileCurrently, I was trying to call the
connect
function from MSSQL extension like this:However, this creates a virtual URI like vscode-mssql-adhoc://query0, which is not tied to the .sql file I opened.
What I would like to do is something like:
That way, the connection is explicitly associated with the file I opened, and the user can run queries without needing to manually select a connection through the Command Palette.
🙋♂️ My question
Is there a supported way to associate a connection profile with a specific .sql file programmatically?
Any guidance or clarification would be greatly appreciated. Thanks in advance!
Beta Was this translation helpful? Give feedback.
All reactions