Skip to content

Commit 8e1bc6c

Browse files
author
haos
committed
Align plugin trigger capability docs
1 parent 80613c3 commit 8e1bc6c

2 files changed

Lines changed: 63 additions & 2 deletions

File tree

plugins/PLUGIN_GUIDE.md

Lines changed: 58 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -101,6 +101,7 @@ The manifest tells Tabularis everything about your plugin.
101101
| `schemas` | bool | `true` if the database supports named schemas (like PostgreSQL). Controls whether the schema selector is shown in the UI. |
102102
| `views` | bool | `true` if the database supports views. Enables the views section in the explorer. |
103103
| `routines` | bool | `true` if the database supports stored procedures/functions. |
104+
| `triggers` | bool | `true` if the database supports triggers. Enables trigger-related UI for drivers that implement the trigger RPCs. |
104105
| `file_based` | bool | `true` for local file databases (e.g., SQLite, DuckDB). Replaces host/port with a file path input in the connection form. |
105106
| `folder_based` | bool | `true` for plugins that connect to a directory rather than a single file (e.g. CSV plugin). Replaces host/port with a folder picker. |
106107
| `no_connection_required` | bool | `true` for API-based plugins that need no host, port, or credentials (e.g. a public REST API). Hides the entire connection form — the user only fills in the connection name. |
@@ -640,8 +641,8 @@ Get column information for a table.
640641
"name": "id",
641642
"data_type": "INTEGER",
642643
"is_nullable": false,
643-
"column_default": null,
644-
"is_primary_key": true,
644+
"default_value": null,
645+
"is_pk": true,
645646
"is_auto_increment": true,
646647
"comment": null
647648
}
@@ -798,6 +799,61 @@ Get the SQL body of a stored routine.
798799

799800
---
800801

802+
### Triggers
803+
804+
Set `capabilities.triggers` to `true` when your driver implements the trigger RPCs. Tabularis uses this flag to show trigger-related UI.
805+
806+
#### `get_triggers`
807+
808+
List triggers in a schema/database.
809+
810+
**Params:** `{ "params": ConnectionParams, "schema": string | null }`
811+
812+
**Result:**
813+
```json
814+
[
815+
{
816+
"name": "users_audit_trg",
817+
"table_name": "users",
818+
"event": "INSERT OR UPDATE",
819+
"timing": "AFTER",
820+
"schema": "public"
821+
}
822+
]
823+
```
824+
825+
---
826+
827+
#### `get_trigger_definition`
828+
829+
Get the SQL definition of a trigger.
830+
831+
**Params:** `{ "params": ConnectionParams, "schema": string | null, "trigger_name": string, "table_name": string }`
832+
833+
**Result:** `"CREATE TRIGGER users_audit_trg ..."`
834+
835+
---
836+
837+
#### `create_trigger`
838+
839+
Create a trigger from SQL generated by the UI or entered in raw SQL mode.
840+
841+
**Params:** `{ "params": ConnectionParams, "schema": string | null, "trigger_sql": string }`
842+
843+
**Result:** `null` on success, or an error.
844+
845+
---
846+
847+
#### `drop_trigger`
848+
849+
Drop a trigger.
850+
851+
**Params:** `{ "params": ConnectionParams, "schema": string | null, "trigger_name": string, "table_name": string }`
852+
853+
**Result:** `null` on success, or an error.
854+
855+
---
856+
801857
### Query Execution
802858

803859
#### `execute_query`

plugins/manifest.schema.json

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -75,6 +75,11 @@
7575
"type": "boolean",
7676
"description": "true to enable stored procedures and functions in the database explorer."
7777
},
78+
"triggers": {
79+
"type": "boolean",
80+
"default": false,
81+
"description": "true if the driver supports trigger metadata and trigger management RPCs."
82+
},
7883
"file_based": {
7984
"type": "boolean",
8085
"description": "true for local file databases (e.g. SQLite, DuckDB). Replaces the host/port fields with a file path input."

0 commit comments

Comments
 (0)