classDropProgram
final class DropProgram
implements Statement
uses Snapshot
@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.
$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 $kindpublic QualifiedName $namepublic bool $ifExists = falseMethods§
public function __construct(
public ProgramKind $kind,
public QualifiedName $name,
public bool $ifExists = false,
)Parameters
$kind | ProgramKind | The kind of stored program dropped |
$name | QualifiedName | The program name with its optional database |
$ifExists | bool | Whether IF EXISTS is written |
Calls 1
- static-call Check::input() line 45
public function deriveStatement(Derivation $derivation): voidDerives nothing: dropping a stored program is a request.
Parameters
$derivation | Derivation |
public function render(Output $out): voidWrites the statement.
Parameters
$out | Output |
Test cases 1
Calls 3
- method-call Output::keyword() line 60
- method-call ProgramNames::qualified() line 64
- new ProgramNames line 64
Test cases 5§
Test cases that cover or call this symbol, from the coverage report and from the analyzed test sources.