microsoft / microsoft/vscode-pgsql
Allow connection profiles to be declared in workspace settings.json for team sharing
Nobody has claimed this yet.
- Dominant language
- No language data
- Stars
- 395
- Forks
- 33
- Avg merge
- 1h 46m
- Merged PRs (30d)
- 3
Description
Problem
Connection profiles in the PostgreSQL extension are stored in VS Code's global secret storage and user settings — neither of which is committed to source control. In a team environment, every developer must manually re-enter connection details (host, port, database, username) for shared databases (dev/staging). There is no way to ship a pre-populated, non-secret connection profile as part of a repository.
Use Case
A team wants to commit a .vscode/settings.json that pre-declares non-secret connection attributes:
{
"pgsql.connections": [
{
"name": "Dev DB (shared)",
"host": "dev-db.internal.example.com",
"port": 5432,
"database": "myapp_dev",
"user": "devuser",
"passwordSource": "prompt" // or "pgpass" | "secretStorage"
}
]
}
When a developer clones the repo and opens it, the connection appears pre-populated in the sidebar — they only need to supply the password.
Why This Is Safe
Passwords are never committed (the passwordSource field controls where the credential comes from). Only non-secret metadata (host, port, db name, user) is in the settings file. This mirrors how SQL Server extension (mssql) handles workspace-level connection profiles.
Proposed Change
- Add
pgsql.connectionsas a workspace-scope configuration key (array of connection descriptors, no password field). - On activation, merge connections from workspace settings into the connections tree (alongside secret-storage ones), displaying a source badge ("workspace" vs "personal").
- Connecting a workspace connection that has no password triggers the normal password prompt and optionally stores it in secret storage for the session.
Environment
- VS Code: 1.89+, team sharing
.vscode/settings.jsonvia git - Extension: ms-ossdata.vscode-pgsql latest
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by tracing extension activation and how connections are loaded into the connections tree, then inspect the existing secret-storage and user-settings paths. Define how workspace descriptors merge with personal connections, how the source badge is shown, and how a missing password reaches the normal prompt. Done means non-secret workspace profiles appear after cloning without committing credentials, and existing personal connections still work.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- postgresql, vscode
- Domain
- databases, devtools
- Issue type
- Feature
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Quiet
- Clarity
- Mostly clear
- Newbie friendliness
- 55/100