microsoft / microsoft/vscode-pgsql
[Feature Request] Support for Read-Only Database Connections
Nobody has claimed this yet.
- Dominant language
- No language data
- Stars
- 395
- Forks
- 33
- Avg merge
- 1h 46m
- Merged PRs (30d)
- 3
Description
Feature Description
I’d like to request support for read-only database connections in the vscode-pgsql extension for Visual Studio Code. This feature would allow users to explicitly mark a PostgreSQL connection as read-only, preventing any data modification operations from being executed through that connection.
Proposed Capabilities
- Ability to mark a connection as read-only during creation or via connection settings.
- Clear visual indication that a connection is read-only (icon, badge, or label).
- Block or warn when attempting write operations, such as:
INSERT,UPDATE,DELETEMERGE,TRUNCATECREATE,ALTER,DROP
- Optional confirmation dialog or error message when running write queries.
- Client-side enforcement regardless of database-level permissions (safety guard).
Problem & Motivation
Currently, vscode-pgsql does not provide a way to explicitly mark connections as read-only. When working with production or sensitive environments, this increases the risk of accidentally executing write operations from the editor.
Even when PostgreSQL permissions are correctly configured, a client-side read-only mode provides an additional safety layer and helps prevent human error.
Use Case
- Safely connecting to production databases for debugging or reporting.
- Allowing developers or analysts to explore data without modification risks.
- Enforcing team-wide safety practices when sharing connection profiles.
- Reducing accidental data changes during query execution.
Request
Please consider adding support for read-only connections in a future release of vscode-pgsql. Even a basic implementation that blocks write queries would significantly improve safety and confidence.
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
The issue names no files or tests. Start by locating the connection creation/settings entry points and the query execution path in the extension. Done would include a way to mark connections read-only, a visible indication, and blocking or warning on the listed write operations.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- postgresql, vscode
- Domain
- database, security
- Issue type
- Feature
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 35/100