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

DROP {DATABASE | SCHEMA} [IF EXISTS] name: a request to remove a database and every table in it.

Mirrors SQLCOM_DROP_DB. Rule: MYSQL-DROP-DATABASE-001. The statement removes no declaration from the context it is analyzed against. Source: https://dev.mysql.com/doc/refman/8.4/en/drop-database.html. Status: Implemented.

Removing a databasedoctest
$drop = (new \SqlSemantics\Platform\MySql\Semantics())->analyze('drop schema if exists shop');
    [$drop->toString(), $drop->statement->ifExists] // => ['DROP DATABASE IF EXISTS shop', true]

Properties§

public bool $ifExists
public Name $name

Methods§

public function __construct(public bool $ifExists, public Name $name)

Parameters

$ifExistsboolWhether IF EXISTS is written
$nameNameThe database name
public function deriveStatement(Derivation $derivation): void

Has nothing to derive: a database is no relation.

Parameters

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

Writes the request.

Parameters

$outOutput
Calls 3

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