Manual · 7

Hooks

Binds a script to a database event: record.created, record.updated, or record.deleted.

Configuration:

  • Table – optional; empty means “for every table in the data source”.
  • Position – a number for ordering, in case several hooks react to the same event.

A hook runs concurrently (fire-and-forget) in its own background task – it never blocks or prevents the actual write, no matter what happens in the script.

The script has access to a global event object:

event.name    // "record.created" | "record.updated" | "record.deleted"
event.table   // { id, schema_name, table_name }
event.record  // the affected row

For the same set of events, but as an external HTTP call instead of a script, see Webhooks.