Multi-Database Manager for VS Code
A complete database management extension for VS Code supporting MySQL, MariaDB, and PostgreSQL.
Features
🗄️ Multi-Database Support
- MySQL - Full support for MySQL databases
- MariaDB - Compatible with MariaDB
- PostgreSQL - Complete PostgreSQL integration
📊 Database Explorer
- Browse databases, tables, columns, indexes, and constraints
- Expand/collapse database objects
- Refresh schema views
- Right-click context menu actions
💻 SQL Query Editor
- Syntax-highlighted SQL editor
- Execute queries with Ctrl+Enter / Cmd+Enter
- Query history tracking
- View results in structured grid
- Export results to CSV/JSON
📋 Data Viewer
- View table data in a grid interface
- Pagination - Navigate through large datasets
- Sorting - Click column headers to sort
- Filtering - Filter rows by column values
- Search - Quick text search across all rows
- Export - Export table data to CSV or JSON
✏️ Data Modification
- Insert Row - Add new records to tables
- Edit Row - Modify existing records (double-click cells)
- Delete Row - Remove records with confirmation
- Duplicate Row - Clone existing rows
- Undo Support - Revert changes before saving
🔒 Security
- Passwords stored using VS Code's secure secret storage
- No plain-text password storage
- Environment variable support
Getting Started
Installing
- Install from VS Code Marketplace
- Open the Database Explorer from the Activity Bar (database icon)
- Click the "+" icon to add a new connection
Adding a Connection
- Click Add Database Connection in the explorer toolbar
- Select database type (MySQL, MariaDB, or PostgreSQL)
- Enter connection details:
- Connection name
- Host
- Port
- Username
- Password
- Database name
Using the SQL Editor
- Right-click a connected connection
- Select Open SQL Query Editor
- Write your SQL query
- Press Ctrl+Enter (or Cmd+Enter on Mac) or click Execute
Viewing Table Data
- Expand a connection → Tables
- Right-click a table
- Select View Top 1000 Rows
- Use the toolbar to insert, edit, delete, or export data
Commands
| Command |
Description |
Add Database Connection |
Add a new database connection |
Connect |
Connect to a database |
Disconnect |
Disconnect from a database |
Refresh |
Refresh the database explorer |
Open SQL Query Editor |
Open the SQL editor |
View Top 1000 Rows |
View table data |
Remove Connection |
Delete a connection |
Configuration
Configure settings in VS Code settings:
{
"multi-db-manager.defaultPageSize": 100,
"multi-db-manager.queryTimeout": 30000,
"multi-db-manager.autoSaveConnections": true
}
Keyboard Shortcuts
| Shortcut |
Action |
Ctrl+Enter / Cmd+Enter |
Execute query in SQL Editor |
Supported Database Objects
- Tables - View structure, columns, indexes, constraints
- Views - Browse database views
- Functions - View stored functions
- CSV - Comma-separated values for spreadsheet applications
- JSON - JSON format for programmatic access
Architecture
src/
├── types/ # TypeScript type definitions
├── providers/ # Database-specific providers
│ ├── databaseProvider.ts # Abstract base provider
│ ├── mysqlProvider.ts # MySQL/MariaDB implementation
│ └── postgresProvider.ts # PostgreSQL implementation
├── views/ # UI view providers
│ ├── databaseExplorer.ts # Tree view for sidebar
│ ├── queryEditorView.ts # SQL editor webview
│ └── dataViewerView.ts # Data grid webview
├── webview/ # HTML/CSS for webviews
│ ├── queryEditor.ts # SQL editor HTML
│ └── dataViewer.ts # Data viewer HTML
├── utils/ # Utility modules
│ ├── connectionManager.ts # Connection lifecycle
│ ├── credentials.ts # Secure storage
│ └── helpers.ts # Helper functions
└── extension.ts # Extension entry point
Future Enhancements
- [ ] Schema comparison tool
- [ ] Migration support
- [ ] Table designer (visual)
- [ ] Visual query builder
- [ ] ER diagram generator
- [ ] SSH tunneling
- [ ] Cloud database support (AWS RDS, Azure Database, etc.)
- [ ] Query execution plans
- [ ] Database backups
- [ ] Multi-table operations
Troubleshooting
Connection Issues
- Verify the database is running and accessible
- Check hostname and port
- Ensure username/password are correct
- For remote databases, verify firewall rules
Query Errors
- Check SQL syntax for your database type
- Verify table and column names
- Ensure proper permissions
Development
# Install dependencies
npm install
# Build
npm run build
# Watch mode (for development)
npm run watch
# Lint
npm run lint
License
MIT
Support
For issues and feature requests, please open an issue on the repository.
Enjoy managing your databases directly from VS Code! 🚀
| |