Borvik / vscode-postgres

PostgreSQL extension for vscode providing explorer, highlighting, diagnostics, and intellisense
MIT License
228 stars 49 forks source link

Choose a connection in an SQL file (configuration by comment) #243

Open Eccenux opened 11 months ago

Eccenux commented 11 months ago

Would be very useful to have an ability to define what is the default connection / database for a given file.

I have a lot of SQL files some of which work on a specific database. Utility scripts for testing and debugging.

So maybe the extension could read some comment like this:

/*
{
"vscode-postgres.defaultConnection": "dev",
"vscode-postgres.defaultDatabase": "bus_library",
}
*/

Connection might be optional (defaults to workspace default):

/*
{
"vscode-postgres.defaultDatabase": "test_claims",
}
*/