A powerful visual database explorer for PostgreSQL that runs directly inside Cursor/VS Code. Built with React, TypeScript, and the pg driver for a modern, responsive development experience.
Version: 0.1.0 | Status: Alpha | License: MIT
- Sidebar Navigation: Browse database schemas and tables in a tree view
- Table Viewer: Display table data with pagination (100 rows per page)
- Column Information: View column names, types, and metadata
- Sticky Headers: Column names always visible while scrolling
- Dynamic Filters: Filter table data by any column
- Multiple Operators: Support for
=,!=,>,<,>=,<=,LIKE - Multi-column Filtering: Apply filters across multiple columns simultaneously
- Column Sorting: Click headers to sort ascending/descending
- Resizable Columns: Drag column borders to adjust width, or drag-and-drop for manual resizing
- Inline Cell Editing: Double-click any cell to edit inline
- Optimistic Updates: Changes appear immediately before server confirmation
- Batch Operations: Save multiple changes at once or cancel all edits
- Pending Changes Indicator: Visual feedback for uncommitted edits
- Dynamic Forms: Auto-generated insert forms based on table schema
- Type-aware Inputs: Appropriate input types based on column data types
- Required Field Validation: Visual indication of required vs optional fields
- SQL Query Editor: Execute any SQL query directly
- Execution Stats: View execution time, row count, and command type
- Example Queries: Quick-start templates for common operations
- Keyboard Shortcuts: Execute queries with
Ctrl+Enter/Cmd+Enter
- Multiple Connections: Save and switch between different database connections
- Secure Storage: Credentials encrypted in VS Code's secure storage (system keychain)
- Connection History: Auto-reconnect to last used connection
- Interactive Setup: Step-by-step credential configuration wizard
- Install the extension from VS Code Marketplace or install
.vsixmanually - Open Command Palette (
Ctrl+Shift+P/Cmd+Shift+P) - Run
PostgreSQL: Open Explorer - Click "Configure Now" to set up database connection
- Enter your database credentials (saved securely)
- Browse schemas and tables in the sidebar
- Click any table to view and edit data
- Node.js: Version 18 or higher (npm comes with Node.js)
- VS Code/Cursor: Version 1.105.0 or higher
- PostgreSQL Database: Local or remote (versions 10+)
- Network Access: Connection to PostgreSQL server with appropriate permissions
- npm: Included with Node.js (required for development scripts)
-
Clone or download this extension
git clone https://github.com/josedugu/easy-db.git cd easy-db -
Install dependencies:
npm install
-
Configure your database credentials (see Configuration section)
-
Open the project in VS Code/Cursor
-
Press
F5to launch the Extension Development Host
-
Build the extension:
npm run compile npm run webview:build
-
Package the extension:
npm run package
-
Install the
.vsixfile:- Open VS Code/Cursor
- Go to Extensions
- Click "..." → "Install from VSIX"
- Select the generated
.vsixfile (e.g.,easydb-0.1.0.vsix)
The easiest way! The extension will guide you through credential setup:
- Launch the extension (press
F5or use "Run Extension") - Click "Configure Now" when prompted
- Enter your credentials step by step:
- Hostname (e.g.,
localhost) - Port (e.g.,
5432) - Database name
- Username
- Password (hidden input)
- Hostname (e.g.,
- Choose whether to save credentials securely
- Done! ✅
Commands:
PostgreSQL: Configure Database Connection- Set up or change credentialsPostgreSQL: Clear Saved Credentials- Remove saved credentials
Security: Credentials are stored in VS Code's secure SecretStorage (uses your system's keychain).
Create a .env file in your workspace root:
DB_HOST=localhost
DB_PORT=5432
DB_NAME=your_database_name
DB_USER=your_username
DB_PASSWORD=your_passwordThe extension auto-detects .env files and uses them if no saved credentials exist.
- Open the PostgreSQL Explorer sidebar (database icon in activity bar)
- Expand schemas to see tables
- Click on any table to view its data
- Open a table
- Click "Toggle Filters"
- Enter filter values and select operators
- Click "Apply Filters"
- Open a table
- Click "Insert Row"
- Fill in the form (required fields marked with *)
- Click "Insert"
- Use Command Palette (
Ctrl+Shift+P/Cmd+Shift+P) - Run command: "Open SQL Query Editor"
- Enter your SQL query
- Click "Execute Query" or press
Ctrl+Enter/Cmd+Enter
PostgreSQL: Refresh Schemas- Reload the schema treePostgreSQL: Open Table- Open a table viewer (triggered by clicking tables)PostgreSQL: Open SQL Query Editor- Open the custom query editor
| Layer | Technology | Purpose |
|---|---|---|
| Extension Core | VS Code Extension API | Commands, webviews, sidebar |
| Backend | Node.js + TypeScript | Connection pooling, query execution |
| Database Driver | pg (node-postgres) |
PostgreSQL connection management |
| Frontend | React 19 + TypeScript | Interactive UI components |
| Build Tool | Vite | Fast webview bundling |
| Styling | VS Code CSS Variables | Theme-aware styling |
src/
├── extension.ts # Main entry point & command registration
├── database/
│ ├── connection.ts # PostgreSQL pool initialization & management
│ ├── credentials.ts # Credential storage (VS Code secrets API)
│ └── queries.ts # SQL query builders with parameterization
├── utils/
│ └── logger.ts # Centralized logging (errors only)
├── views/
│ └── dashboardPanel.ts # Webview manager & message bridge
└── webview/
├── App.tsx # Main React application
├── components/ # UI Components
│ ├── ConnectionForm.tsx # Connection configuration
│ ├── DataTable.tsx # Table display with inline editing
│ ├── TableView.tsx # Table viewer with pagination
│ ├── DataPage.tsx # Main data exploration page
│ └── Sidebar.tsx # Schema/table navigation
├── hooks/
│ └── useVSCode.ts # VS Code API integration (postMessage)
├── types/
│ └── index.ts # TypeScript interfaces
└── utils/
└── browserStorage.ts # LocalStorage persistence (dev mode)
- Extension loads → VS Code activates extension, creates webview panel
- Message Bridge → Webview (React) ↔ Extension (Node.js) via
postMessage - Database Connection →
pgdriver manages connection pool with SSL auto-detection - Query Execution → Parameterized queries prevent SQL injection
- UI Updates → Real-time feedback with optimistic updates for edits
- Connection Pooling: Uses
pglibrary's built-in pool for efficient connection reuse - Parameterized Queries: All queries use
$1, $2placeholders to prevent SQL injection - SSL Auto-detection: Enables SSL for remote connections, disables for localhost
- Sticky Headers: CSS
position: stickykeeps column names visible during scroll - Resizable Columns: Custom drag-to-resize implementation with real-time width tracking
- Parameterized Queries: All user input is safely parameterized using
$1, $2placeholders (viapgdriver) - SQL Injection Protection: Prevents injection attacks via proper parameter binding
- Credential Encryption: Passwords stored in VS Code's
SecretStorageAPI (uses system keychain) - SSL/TLS Support: Auto-enables for remote connections, disabled for localhost
- No Credential Logging: Credentials are never logged or exposed in error messages
- Input Validation: Database names and identifiers are validated before use
- Connection Pooling: Managed by
pglibrary for connection reuse - Pagination: Tables load 100 rows at a time (configurable)
- Efficient Queries: Only fetches necessary data with LIMIT/OFFSET
- Sticky Headers: No performance impact from fixed column headers
- Resizable Columns: Drag-to-resize uses efficient DOM manipulation
- Bundle Size: ~67KB gzipped for webview (React + UI)
- Ensure you've configured database credentials
- Check that PostgreSQL server is running
- Restart the extension (
PostgreSQL: Open Explorer)
- Verify database credentials are correct
- Check network connectivity to the database
- Ensure the user has appropriate schema permissions
- Check logs:
PostgreSQL: Show Logs
- Ensure the table has a primary key
- Check that you have UPDATE permissions
- Verify the new value is compatible with the column data type
- Make sure the extension is installed: check Extensions panel
- Rebuild the extension:
npm run build:all - Restart VS Code/Cursor
- Ensure you're clicking exactly on the column border (right edge)
- Cursor should change to
col-resizewhen hovering over the border - Try scrolling horizontally first, then resizing
# Install Node dependencies
npm install
# TypeScript version 5+ is required (peer dependency)
npm install -D typescript@^5# Compile TypeScript to JavaScript
npm run compile
# Watch mode (recompile on file changes)
npm run watch
# Build webview (React app)
npm run webview:build
# Watch webview (live rebuild)
npm run webview:dev
# Build everything (TypeScript + webview)
npm run build:all
# Package extension as .vsix
npm run package- Open the project in VS Code
- Press
F5to launch Extension Development Host - In a separate terminal, run
npm run webview:devfor live reloading - Changes to TypeScript will require rebuild (use
npm run watch) - Changes to webview are hot-reloaded (Vite)
- Refactor
dashboardPanel.ts(2,500+ LOC) → Split into:- Connection manager service
- Database query service
- Message handler service
- This will improve maintainability, testability, and reduce cognitive complexity
- Delete Operations: Delete rows with confirmation dialog
- Export Data: Export tables to CSV/JSON formats
- Import Data: Import data from CSV files
- Query History: Track and replay previously executed queries
- Saved Queries: Save frequently used queries as snippets
- Advanced Filtering: Multi-condition filters with AND/OR logic
- Schema Diagrams: Visual relationship diagrams between tables
- Virtual Scrolling: Handle 10K+ rows without performance degradation
- Lazy Loading: Load data on-demand for large tables
- Query Optimization: Automatic index suggestions
- Multi-database: MySQL, SQLite, MariaDB support
- Transactions: UI for transaction management (BEGIN/COMMIT/ROLLBACK)
MIT
Contributions are welcome! Please feel free to submit issues or pull requests.
- pg (^8.11.3) - PostgreSQL client driver with connection pooling
- react (^19.2.0) - UI library
- react-dom (^19.2.0) - React DOM rendering
- TypeScript (^5) - Type-safe JavaScript
- Vite (^7.1.10) - Fast webview bundling
- @types/react - TypeScript types for React
- @vitejs/plugin-react - React support for Vite
- @vscode/vsce - VS Code Extension CLI
Built with:
- VS Code Extension API - Extension framework
- node-postgres (pg) - PostgreSQL client
- React - UI framework
- Vite - Frontend build tool
- Inspired by database management tools like pgAdmin, DBeaver, and TablePlus