URL Scheme
Tablen registers the tablen:// URL scheme, allowing external applications, scripts, and web pages to interact with the app.
Scheme Format
tablen://<action>?<parameters>
Supported Routes
Connect by Name
Open and connect to a saved connection by its display name.
tablen://connect?name=MyDatabase
Parameters:
| Parameter | Required | Description |
|---|---|---|
| name | Yes | The display name of the saved connection |
Behavior: Searches saved connections for a matching name and initiates a connection. If no match is found, nothing happens.
Connect by ID
Open and connect to a saved connection by its UUID.
tablen://connect?id=550e8400-e29b-41d4-a716-446655440000
Parameters:
| Parameter | Required | Description |
|---|---|---|
| id | Yes | The UUID of the saved connection |
Behavior: Looks up the connection by UUID and initiates a connection. More reliable than connecting by name since IDs are unique.
Open Query
Open a new tab with pre-filled SQL, optionally executing it immediately.
tablen://query?sql=SELECT * FROM users&run=true
Parameters:
| Parameter | Required | Description |
|---|---|---|
| sql | Yes | The SQL query to load into the editor |
| run | No | Set to true or 1 to execute immediately (default: false) |
Behavior: Creates a new query tab with the provided SQL. If run=true, the query executes automatically after loading.
Example -- just open without running:
tablen://query?sql=SELECT COUNT(*) FROM orders
Example -- open and run:
tablen://query?sql=SELECT COUNT(*) FROM orders&run=true
New Connection
Open the New Connection dialog.
tablen://new-connection
Parameters: None
Behavior: Opens the connection creation sheet, ready for you to fill in connection details.
Install Plugin
Install a plugin from the marketplace by its slug.
tablen://plugin/install?slug=postgresql-monitor
Parameters:
| Parameter | Required | Description |
|---|---|---|
| slug | Yes | The plugin's marketplace slug identifier |
Behavior: Opens the Plugin Manager and initiates installation of the specified plugin.
Usage Examples
From Terminal
open "tablen://connect?name=Production DB"
open "tablen://query?sql=SELECT version()&run=true"
open "tablen://new-connection"
open "tablen://plugin/install?slug=mysql-essentials"
From a Script
#!/bin/bash
# Connect to database and run a health check
open "tablen://connect?name=MainDB"
sleep 2
open "tablen://query?sql=SELECT 1 AS health_check&run=true"
From a Web Page
<a href="tablen://connect?name=DevDB">Open in Tablen</a>
<a href="tablen://query?sql=SELECT * FROM users LIMIT 10">View Users</a>
<a href="tablen://plugin/install?slug=postgresql-essentials">Install PostgreSQL Essentials</a>
From Alfred/Raycast
Create a custom workflow that passes SQL to Tablen:
tablen://query?sql={query}&run=true
URL Encoding
Remember to URL-encode special characters in your SQL queries:
- Space:
%20 - Asterisk:
%2A - Equals:
%3D - Ampersand:
%26 - Single quote:
%27
Example with encoding:
tablen://query?sql=SELECT%20*%20FROM%20users%20WHERE%20name%20%3D%20%27John%27
Security Notes
- URL scheme actions respect Safe Mode -- destructive queries opened via URL will still require confirmation
- Passwords are never accepted via URL parameters
- Connection by name/ID only works for already-saved connections