Plugin System
Tablen's plugin system allows you to extend the application with custom snippets, themes, query formatters, lint rules, dashboard widgets, and connection templates. Plugins can be created locally, shared with your team, or published to the public marketplace.
Plugin Types
Snippets
Reusable SQL query templates:
- Fields: name, query, description, database type filter
- Usage: Quickly insert frequently used SQL patterns
- Database Filter: Optionally restrict snippets to specific database types (PostgreSQL, MySQL, etc.)
Connection Template
Pre-configured connection settings:
- Save common connection configurations as templates
- Apply templates when creating new connections
- Useful for standardizing team connection settings
Query Formatter
Custom SQL formatting rules:
- Define how SQL should be formatted
- Applied when using the Format SQL command (Cmd+Shift+F)
- Can be database-type specific
Lint Rule
Custom SQL linting rules:
- Fields: name, pattern (regex), severity, message, suggestion, database type filter
- Severity Levels: Error, Warning, Info
- Rules are checked in real-time as you type
- Suggestions are shown alongside lint warnings
Dashboard
Custom dashboard widgets:
- Chart Types: Number, Bar, Line, Table
- Features: Auto-refresh interval, database type filter
- Widgets appear in the connection-specific dashboard
- Define SQL queries that power each widget
Theme
Custom color themes for the editor and interface:
- Customizable Colors:
editorBackground-- Editor background coloreditorForeground-- Editor text colorsyntaxKeyword-- SQL keyword colorsyntaxString-- String literal colorsyntaxComment-- Comment colorsyntaxNumber-- Number literal colorsyntaxFunction-- Function name colorsidebarBackground-- Sidebar background colorsidebarForeground-- Sidebar text colortableHeaderBackground-- Result table header colortableAlternateRow-- Alternating row color
Plugin Visibility
| Visibility | Icon | Description |
|---|---|---|
| Private | Lock | Only visible to you |
| Public | Globe | Visible to all Tablen users in the marketplace |
| Team | People | Visible to your team members |
Plugin Management
Accessing Plugin Manager
- Go to Settings > Plugins
- Or use the Command Palette and search for "Plugins"
Installing Plugins
- Open the Plugin Manager
- Browse the marketplace or search for a plugin
- Click "Install" to add the plugin
- The plugin is enabled immediately after installation
Installing via URL Scheme
Install plugins directly using a URL:
tablen://plugin/install?slug=postgresql-monitor
Uninstalling Plugins
- Open the Plugin Manager
- Find the plugin in your installed list
- Click "Uninstall" to remove it
Enabling/Disabling Plugins
Toggle individual plugins on or off without uninstalling them.
Publishing Plugins
- Create your plugin locally
- Set visibility to "Public" or "Team"
- Click "Publish" to upload to the marketplace
Built-In Plugins
Tablen comes with several built-in plugins:
| Plugin | Type | Description |
|---|---|---|
| PostgreSQL Essentials | Snippets | Common PostgreSQL queries and operations |
| MySQL Essentials | Snippets | Common MySQL queries and operations |
| SQLite Essentials | Snippets | Common SQLite queries and operations |
| SQL Safety Rules | Lint Rule | Safety-focused lint rules to prevent dangerous SQL |
| PostgreSQL Monitor | Dashboard | PostgreSQL monitoring dashboard widgets |
Plugin Storage
Plugins are stored locally at:
~/Library/Application Support/DBClient/plugins/
Each plugin type has its own subdirectory with a registry.json file that tracks installed plugins.
Marketplace
The plugin marketplace provides:
- Browse: Discover public plugins
- Search: Find plugins by name or description
- Install/Uninstall: One-click installation
- Sync: Synchronize installed plugins across devices
- Server Sync: Sync plugin data with the Tablen server
Creating a Plugin
Snippets Plugin
{
"name": "My Snippets",
"type": "Snippets",
"content": {
"snippets": [
{
"name": "Count All",
"query": "SELECT COUNT(*) FROM {{table}};",
"description": "Count all rows in a table",
"dbType": null
}
]
}
}
Lint Rule Plugin
{
"name": "No SELECT *",
"type": "Lint Rule",
"content": {
"lintRules": [
{
"name": "Avoid SELECT *",
"pattern": "SELECT\\s+\\*",
"severity": "warning",
"message": "Avoid using SELECT * in production queries",
"suggestion": "List specific columns instead",
"dbType": null
}
]
}
}
Theme Plugin
{
"name": "My Dark Theme",
"type": "Theme",
"content": {
"theme": {
"editorBackground": "#1E1E2E",
"editorForeground": "#CDD6F4",
"syntaxKeyword": "#CBA6F7",
"syntaxString": "#A6E3A1",
"syntaxComment": "#6C7086",
"syntaxNumber": "#FAB387",
"syntaxFunction": "#89B4FA",
"sidebarBackground": "#181825",
"sidebarForeground": "#CDD6F4",
"tableHeaderBackground": "#313244",
"tableAlternateRow": "#1E1E2E"
}
}
}