PostgreSQL Explorer for VS Code

A powerful PostgreSQL database explorer with interactive SQL notebooks, table visualization, and data export capabilities.
✨ Key Features
🔌 Easy Database Connection
- Quick connection setup with secure credential storage
- Support for multiple database connections
- Auto-reconnect and connection health monitoring
📊 Interactive SQL Notebooks
- Write and execute SQL queries in notebook cells
- Rich table output with sorting capabilities
- Export results to CSV and Excel formats
- View execution status and row counts
🌳 Smart Database Explorer
- Tree view of databases, schemas, and tables
- Quick access to table properties and structure
- Real-time database structure updates
- Context-aware actions for each item
📋 Table Properties Panel
- Detailed view of table structure
- Column definitions and data types
- Primary keys and foreign key relationships
- Index information and constraints
🚀 Quick Start
1. Connect to Your Database
- Click the PostgreSQL icon in the Activity Bar (or press
Ctrl+Shift+P and search for "PostgreSQL: Add Connection")
- Click the "+" button to add a new connection
- Enter your connection details:
Host: localhost (or your database host)
Port: 5432 (default PostgreSQL port)
Username: your_username
Password: your_password
Database: your_database
- Save the connection
2. Explore Your Database
- Expand the connection in the tree view to see databases
- Navigate through schemas and tables
- Right-click items for context actions
3. Create SQL Notebooks
- Right-click on any database, schema, or table
- Select "New PostgreSQL Notebook"
- Write SQL in notebook cells:
-- Example query
SELECT * FROM users
WHERE created_at >= NOW() - INTERVAL '7 days'
ORDER BY created_at DESC;
- Press
Ctrl+Enter to execute a cell
4. Work with Results
- Click column headers to sort results
- Use the export buttons to save data:
- CSV: For spreadsheet applications
- Excel: For Microsoft Excel
💡 Pro Tips
Quick Table Info
- Click any table in the explorer to see its structure
- Hover over columns to see data types and constraints
Efficient Querying
- Use table names from the explorer (drag & drop supported)
- Save commonly used queries in notebooks
- Use multiple cells for complex operations
Data Export
- Large result sets are automatically paginated
- Exports preserve data types and formatting
- Files are saved in your workspace root
⚙️ Extension Settings
Customize through VS Code settings (Ctrl+, ):
{
"postgresExplorer.connections": [], // Saved connections
"postgresExplorer.autoConnect": true, // Auto-connect on startup
"postgresExplorer.maxResults": 1000 // Max rows per query
}
🔧 Troubleshooting
Common Issues
Connection Failed
- Verify host and port are correct
- Check username and password
- Ensure database server is running
- Check firewall settings
Query Timeout
- Reduce the data set with WHERE clauses
- Use LIMIT to restrict results
- Consider indexing frequently queried columns
Export Issues
- Ensure write permissions in workspace
- Close files in other applications
- Check available disk space
📝 License
This extension is licensed under the MIT License.
🤝 Contributing
We welcome contributions! Please see our Contributing Guide for details.
📫 Support
Enjoying the extension? Rate us on the marketplace ⭐
| |