TriggerDefinition
Declarative trigger guard attached to a table. The trigger raises
and aborts the statement when evaluates true for the affected row. Diffed by
name and materialised by the platform DDL generator, like RLS policies.
public sealed record TriggerDefinition : IEquatable<TriggerDefinition>
Properties
Name
public string Name { get; init; }
Trigger name -- unique within the table.
Timing
public TriggerTiming Timing { get; init; }
When the trigger fires relative to the event. Default Before.
Events
public IReadOnlyList<TriggerEvent> Events { get; init; }
Events the trigger fires on. At least one is required.
ForEachRow
[YamlMember(DefaultValuesHandling = DefaultValuesHandling.Preserve)]
public bool ForEachRow { get; init; }
True to fire once per affected row (default).
RaiseWhenLql
[YamlMember(Alias = "raiseWhen")]
public string? RaiseWhenLql { get; init; }
LQL guard predicate. Row column references use old./new.
prefixes; supports and/or composition and
[not] exists(pipeline) subqueries. Implements
[MIG-TRIGGER-GUARD-LQL].
ErrorMessage
public string? ErrorMessage { get; init; }
Error message raised when the guard predicate holds.