Configures Postgres triggers and database webhooks for event-driven architectures in Supabase.
97
97%
Does it follow best practices?
Impact
Pending
No eval scenarios have been run
Critical
Do not install without reviewing
Configures Postgres triggers and database webhooks for event-driven architectures in Supabase.
This tile creates Postgres triggers that fire HTTP webhooks via pg_net when INSERT, UPDATE, or DELETE events occur on specified tables. Payloads are serialized with row_to_json. Triggers MUST scope UPDATE events to specific columns to prevent spurious firings. All DDL runs through MCP execute_sql.
SELECT net.http_post(
url := '<endpoint>',
headers := '{"Content-Type": "application/json"}'::jsonb,
body := row_to_json(NEW)::text
);| Artifact | Pattern | Example |
|---|---|---|
| Trigger | trg_<table>_<event>_webhook | trg_orders_insert_webhook |
| Function | fn_<table>_<event>_webhook | fn_orders_insert_webhook |
AFTER INSERT — fires on new row creation.AFTER UPDATE OF <columns> — fires on specific column changes only.AFTER DELETE — fires on row removal.