Skip to content

Commit 1de4aad

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

2 files changed

Lines changed: 70 additions & 2 deletions

File tree

plugins/PLUGIN_GUIDE.md

Lines changed: 59 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -101,12 +101,14 @@ 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. |
107108
| `connection_string` | bool | Set `false` to hide the connection string import UI for this driver. Defaults to `true` for network drivers. `file_based` and `folder_based` drivers skip the import UI automatically regardless of this flag. |
108109
| `connection_string_example` | string | Optional placeholder example shown in the connection string import field (e.g. `"clickhouse://user:pass@localhost:9000/db"`). Also accepted as camelCase `connectionStringExample`. |
109110
| `identifier_quote` | string | Character used to quote SQL identifiers. Use `"\""` for ANSI standard or `` "`" `` for MySQL style. |
111+
| `sql_dialect` | string | Optional statement-splitting dialect: `postgres`, `mysql`, `mssql`, `sqlite`, `oracle`, or `generic`. Oracle-like plugins, including DM/Dameng, should use `"oracle"`. |
110112
| `alter_primary_key` | bool | `true` if the database supports altering primary keys after table creation. |
111113
| `manage_tables` | bool | `true` to enable table and column management UI (Create Table, Add/Modify/Drop Column, Drop Table). Does not control index or FK operations. Defaults to `true`. |
112114
| `readonly` | bool | When `true`, the driver is read-only: all data modification operations (INSERT, UPDATE, DELETE) are disabled in the UI. The add/delete row buttons, inline cell editing, and context menu edit actions are hidden. Table and column management is also hidden regardless of `manage_tables`. Defaults to `false`. |
@@ -640,8 +642,8 @@ Get column information for a table.
640642
"name": "id",
641643
"data_type": "INTEGER",
642644
"is_nullable": false,
643-
"column_default": null,
644-
"is_primary_key": true,
645+
"default_value": null,
646+
"is_pk": true,
645647
"is_auto_increment": true,
646648
"comment": null
647649
}
@@ -798,6 +800,61 @@ Get the SQL body of a stored routine.
798800

799801
---
800802

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

803860
#### `execute_query`

plugins/manifest.schema.json

Lines changed: 11 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."
@@ -109,6 +114,12 @@
109114
"enum": ["\"", "`"],
110115
"description": "Character used to quote SQL identifiers: double-quote for ANSI SQL, backtick for MySQL-style."
111116
},
117+
"sql_dialect": {
118+
"type": "string",
119+
"enum": ["postgres", "mysql", "mssql", "sqlite", "oracle", "generic"],
120+
"default": "postgres",
121+
"description": "SQL dialect used by Tabularis for statement splitting and query classification. Oracle-like plugins can use oracle."
122+
},
112123
"alter_primary_key": {
113124
"type": "boolean",
114125
"description": "true if the database supports altering primary keys after table creation."

0 commit comments

Comments
 (0)