Skip to content

Feature Request: could we expose an api or command to automate connecting to a db ? #16954

Open
@bbsimonbb

Description

@bbsimonbb

The existing command, MS SQL:connect, leads into some UI to let the user select a connection. Could we expose via an exports, an api that takes a connection string and directly invokes the connect() function?

"Why?", you very reasonably ask. I'm an extension author. When a user edits a sql file, my extension knows what DB they want to connect to, and I would love to be able to connect them directly. The repeated steps of finding the connect command and choosing the connection profile are totally redundant. As a user, if I'm editing the file, of course I want to be connected to the db.

I'm sure there are other uses and scenarios. It would be very cool to set up a task on a project that would automagically connect all sql editor windows to the project's development db, or remember the choice of connection from the last time the document was opened. Perhaps developmentConnectionString could be a property in project.json and vscode-mssql could just do it all?

I would be very happy to try contributing on this subject, with some guidance, if that's appropriate?

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions