microsoft / microsoft/vscode-pgsql

Allow connection profiles to be declared in workspace settings.json for team sharing

Open
#276 2 comments 5 reactions 0 assignees View on GitHub

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

  1. Add pgsql.connections as a workspace-scope configuration key (array of connection descriptors, no password field).
  2. On activation, merge connections from workspace settings into the connections tree (alongside secret-storage ones), displaying a source badge ("workspace" vs "personal").
  3. 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.json via git
  • Extension: ms-ossdata.vscode-pgsql latest

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. 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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.