Skip to content

[Feature Request] Support for Read-Only Database Connections #212

@ericgomez

Description

@ericgomez

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, DELETE
    • MERGE, TRUNCATE
    • CREATE, 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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions