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

SHOW CREATE DATABASE (SHOW CREATE SCHEMA): the statement that creates a database.

Rule: MYSQL-SHOW-CREATE-DATABASE-001. IF NOT EXISTS makes the returned statement carry the same clause. The columns are those of the layout of MYSQL-SHOW-ROWS-001. Terminates: a fixed layout. Source: https://dev.mysql.com/doc/refman/8.4/en/show-create-database.html. Status: Implemented.

Reading the statementdoctest
$show = (new \SqlSemantics\Platform\MySql\Semantics())->analyze('SHOW CREATE SCHEMA IF NOT EXISTS shop');
    [$show->field(1)->name?->value, $show->toString()] // => ['Create Database', 'SHOW CREATE DATABASE IF NOT EXISTS shop']

Properties§

public Name $name
public bool $ifNotExists = false

Methods§

public function __construct(public Name $name, public bool $ifNotExists = false)

Parameters

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

Derives the rows.

Parameters

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

Writes the statement.

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 2