classDropDatabase
final class DropDatabase
implements Statement
uses Snapshot
Public API: explicitly declared with
@visibility public.A request to remove a database.
Rule: PG-DROPDB-001. Mirrors DropdbStmt. The options are kept in the order written, repetitions included; the optional WITH before them is not kept. Source: https://www.postgresql.org/docs/17/sql-dropdatabase.html. Status: Implemented.
$operation = (new \SqlSemantics\Platform\PostgreSql\Semantics())->analyze('DROP DATABASE IF EXISTS d (FORCE)');
[$operation->statement->ifExists, $operation->toString()] // => [true, 'DROP DATABASE IF EXISTS d WITH (FORCE)']Properties§
public list<DropDatabaseOption> $optionspublic Name $namepublic bool $ifExists = falseMethods§
public function __construct(
public Name $name,
public bool $ifExists = false,
list<DropDatabaseOption> $options = [],
)Parameters
$name | Name | The database name |
$ifExists | bool | Whether IF EXISTS is written |
$options | list<DropDatabaseOption> | The options in the order written |
Calls 2
- static-call Check::listOf() line 43
- class-const DropDatabaseOption::class() line 43
public function deriveStatement(Derivation $derivation): voidDerives nothing: a database is not part of a declaration context.
Parameters
$derivation | Derivation |
public function render(Output $out): voidWrites the request.
Parameters
$out | Output |
Calls 4
- method-call Output::keyword() line 58
- method-call Output::name() line 62
- class-const NameUse::Column() line 62
- method-call Output::symbol() line 67
Test cases 1§
Test cases that cover or call this symbol, from the coverage report and from the analyzed test sources.
Dedicated tests 1
DropDatabaseTestcalls
Relations§
Instantiated in 4
- new SqlSemantics\Platform\PostgreSql\Lowering\Catalog\DatabaseRule::statement() packages/sql-semantics-postgres/src/Lowering/Catalog/DatabaseRule.php:83
- new SqlSemantics\Platform\PostgreSql\Lowering\Catalog\DatabaseRule::statement() packages/sql-semantics-postgres/src/Lowering/Catalog/DatabaseRule.php:84
- new SqlSemantics\Platform\PostgreSql\Lowering\Catalog\DatabaseRule::statement() packages/sql-semantics-postgres/src/Lowering/Catalog/DatabaseRule.php:85
- new SqlSemantics\Platform\PostgreSql\Lowering\Catalog\DatabaseRule::statement() packages/sql-semantics-postgres/src/Lowering/Catalog/DatabaseRule.php:86