classCreateEventTrigger
final class CreateEventTrigger
implements Statement
uses Snapshot
Public API: explicitly declared with
@visibility public.A request to create an event trigger: a function that runs on DDL events.
Mirrors PostgreSQL's CreateEventTrigStmt (trigname, eventname, whenclause, funcname). The event must be one the server knows and the filter variable must be tag; others are reported. PROCEDURE for FUNCTION is not kept. Source: https://www.postgresql.org/docs/17/sql-createeventtrigger.html.
$statement = (new \SqlSemantics\Platform\PostgreSql\Semantics())->analyze('CREATE EVENT TRIGGER e ON sql_drop EXECUTE PROCEDURE f()');
$statement->toString() // => 'CREATE EVENT TRIGGER e ON sql_drop EXECUTE FUNCTION f()'Properties§
public list<EventFilter> $filterspublic Name $namepublic Name $eventpublic DottedName $functionMethods§
public function __construct(
public Name $name,
public Name $event,
public DottedName $function,
list<EventFilter> $filters = [],
)Parameters
$name | Name | The trigger name |
$event | Name | The event |
$function | DottedName | The function |
$filters | list<EventFilter> | The WHEN items |
Calls 2
- static-call Check::listOf() line 52
- class-const EventFilter::class() line 52
public function deriveStatement(Derivation $derivation): voidReports an unknown event or filter variable.
Parameters
$derivation | Derivation |
Calls 2
- method-call Triggers::event() line 60
- new Triggers line 60
public function render(Output $out): voidWrites the statement.
Parameters
$out | Output |
Calls 4
- method-call Output::keyword() line 68
- class-const NameUse::Label() line 68
- method-call Writing::separated() line 71
- new Writing line 71
Test cases 1§
Test cases that cover or call this symbol, from the coverage report and from the analyzed test sources.
Dedicated tests 1
CreateEventTriggerTestcalls