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.

Creating an event triggerdoctest
$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> $filters
public Name $name
public Name $event
public DottedName $function

Methods§

public function __construct(
    public Name $name,
    public Name $event,
    public DottedName $function,
    list<EventFilter> $filters = [],
)

Parameters

$nameNameThe trigger name
$eventNameThe event
$functionDottedNameThe function
$filterslist<EventFilter>The WHEN items
Calls 2
public function deriveStatement(Derivation $derivation): void

Reports an unknown event or filter variable.

Parameters

$derivationDerivation
Calls 2
public function render(Output $out): void

Writes the statement.

Parameters

$outOutput
Calls 4

Test cases 1§

Test cases that cover or call this symbol, from the coverage report and from the analyzed test sources.

Dedicated tests 1

Relations§

Instantiated in 1
Type declarations 2