final class AlterEvent
    implements Statement
    uses Snapshot
Public API: explicitly declared with @visibility public.

ALTER EVENT: changes the schedule, name, status, comment or statement of an event.

Every clause is optional in the grammar; a statement without any clause is still structured (the server rejects it). The statement changes no context. The facts follow MYSQL-EVENT-001. Source: https://dev.mysql.com/doc/refman/8.4/en/alter-event.html.

Reading the changes of an eventdoctest
$alter = (new \SqlSemantics\Platform\MySql\Semantics())->analyze('ALTER EVENT e RENAME TO shop.f ENABLE');
    [$alter->statement->newName->name->value, $alter->statement->status, $alter->statement->schedule] // => ['f', \SqlSemantics\Platform\MySql\Statement\Routine\Event\EventStatus::Enable, null]

Properties§

public Schedule|null $schedule = null
public Completion|null $completion = null
public QualifiedName|null $newName = null
public EventStatus|null $status = null
public Text|null $comment = null
public Account|null $definer = null

Methods§

public function __construct(
    public QualifiedName $name,
    public Schedule|null $schedule = null,
    public Completion|null $completion = null,
    public QualifiedName|null $newName = null,
    public EventStatus|null $status = null,
    public Text|null $comment = null,
    Node|null $body = null,
    public Account|null $definer = null,
)

Parameters

$nameQualifiedNameThe event name with its optional database
$scheduleSchedule|nullThe new schedule, when written
$completionCompletion|nullThe ON COMPLETION clause, when written
$newNameQualifiedName|nullThe name of RENAME TO, when written
$statusEventStatus|nullThe status clause, when written
$commentText|nullThe COMMENT clause, when written
$bodyNode|nullThe new statement after DO, when written: a program statement or an SQL statement
$definerAccount|nullThe DEFINER clause, when written

Throws

InvalidConstruction When the body is of another class
Calls 3
public function deriveStatement(Derivation $derivation): void

Derives the schedule and the body, when written.

Parameters

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

Test cases 12§

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

Dedicated tests 5
Other tests reaching this symbol 7

Relations§

Instantiated in 1
Type checks 1
Type declarations 1