prorm API Reference
    Preparing search index...

    Interface TriggerDefinition

    A trigger: when it fires, on which events, and the body it runs.

    interface TriggerDefinition {
        name: string;
        table: string;
        timing: "BEFORE" | "AFTER" | "INSTEAD OF";
        event: "INSERT" | "UPDATE" | "DELETE";
        body: string;
        forEach?: "ROW" | "STATEMENT";
        when?: string;
    }
    Index
    name: string
    table: string
    timing: "BEFORE" | "AFTER" | "INSTEAD OF"
    event: "INSERT" | "UPDATE" | "DELETE"
    body: string

    Statement body (without BEGIN/END for simple single-statement triggers)

    forEach?: "ROW" | "STATEMENT"

    Row- vs statement-level (defaults to row)

    when?: string

    Condition guarding the trigger