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

DROP PROCEDURE, DROP FUNCTION, DROP TRIGGER or DROP EVENT.

Rule: MYSQL-DROP-PROGRAM-001. The statement is structured as a request only: it changes no context and derives nothing. DROP FUNCTION with an unqualified name drops a stored function of the current database or, when there is none, a loadable function of that name; which one is not decided here. Source: https://dev.mysql.com/doc/refman/8.4/en/drop-procedure.html, https://dev.mysql.com/doc/refman/8.4/en/drop-function-loadable.html, https://dev.mysql.com/doc/refman/8.4/en/drop-trigger.html, https://dev.mysql.com/doc/refman/8.4/en/drop-event.html. Status: Implemented.

Reading a DROP TRIGGERdoctest
$drop = (new \SqlSemantics\Platform\MySql\Semantics())->analyze('DROP TRIGGER IF EXISTS shop.tr');
    [$drop->statement->kind->value, $drop->statement->ifExists, $drop->statement->name->schema->value] // => ['TRIGGER', true, 'shop']

Properties§

public ProgramKind $kind
public bool $ifExists = false

Methods§

public function __construct(
    public ProgramKind $kind,
    public QualifiedName $name,
    public bool $ifExists = false,
)

Parameters

$kindProgramKindThe kind of stored program dropped
$nameQualifiedNameThe program name with its optional database
$ifExistsboolWhether IF EXISTS is written
Calls 1
public function deriveStatement(Derivation $derivation): void

Derives nothing: dropping a stored program is a request.

Parameters

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

Writes the statement.

Parameters

$outOutput
Test cases 1
Calls 3

Test cases 5§

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

Dedicated tests 3
Other tests reaching this symbol 2

Relations§

Instantiated in 2
Type checks 1
Type declarations 1