microsoft / microsoft/vscode-pgsql
[Feature Request]: Support bulk creation/import of PostgreSQL connections
Nobody has claimed this yet.
- Dominant language
- No language data
- Stars
- 395
- Forks
- 33
- Avg merge
- 1h 46m
- Merged PRs (30d)
- 3
Description
At the moment, PostgreSQL connections must be added one by one through the extension UI, which is slow and repetitive when working with many environments (DEV, QA, STAGING, multiple servers, etc.). For users and teams managing dozens of databases, a way to define and import all connections at once would greatly improve productivity and reduce configuration errors.
Proposed Feature
1. Import/Export connections
- Command to export all existing connections to a JSON/YAML file.
- Command to import from such a file and create/update multiple connections in one operation.
- Optional support for environment variables for passwords/connection strings so secrets are not stored in plain text.
2. Connection definition format
- Each connection entry should support:
- Label/name
- Host, port
- Database name
- Authentication
- SSL and advanced options
- Optional grouping/folder (e.g., DEV, QA, PROD, project name)
Example (pseudo‑JSON):
{
"groups": [
{
"name": "DEV",
"connections": [
{
"label": "Local Dev",
"host": "localhost",
"port": 5432,
"database": "my_app_dev",
"user": "dev_user",
"passwordEnv": "MY_APP_DEV_DB_PASSWORD"
},
{
"label": "Shared Dev",
"connectionStringEnv": "MY_APP_SHARED_DEV_DB_URL"
}
]
}
]
}
3. UI entry points
- New commands such as:
PostgreSQL: Import Connections From File…PostgreSQL: Export Connections To File…
- Context menu items on the PostgreSQL view (tree) to trigger import/export.
4. Validation and safety
- Validate the file before applying changes (required fields, duplicate labels, invalid options).
- Show a preview of connections that will be created or updated, with confirmation.
- Option to require that secrets come from environment variables or a secret store.
Benefits / Use Cases
- Fast setup of the same connection set on multiple machines or developer environments.
- Easier onboarding for new team members: they import a single config file and are ready to work.
- Ability to keep non‑secret connection metadata (labels, hosts, database names) under version control for a project, improving consistency across the team.
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 with the PostgreSQL view (tree), its context menu, and the existing extension UI for adding connections; no files or tests are named in the issue. Define the connection file format and import/export behavior first, then establish validation, preview, secret handling, grouping, and update rules before implementation. Done means the commands and context-menu actions support validated bulk import and export with confirmation.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- postgresql
- Domain
- databases
- Issue type
- Feature
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 28/100