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

USE: makes a database the current database of the session.

Rule: MYSQL-USE-001. The statement is a request; it does not change the context, so later statements analyzed with the same context still use the current database the context names. Facts: none (databases are not part of a context). Terminates: a leaf. Source: https://dev.mysql.com/doc/refman/8.4/en/use.html. Status: Implemented.

Reading USEdoctest
$use = (new \SqlSemantics\Platform\MySql\Semantics())->analyze('use `my db`');
    [$use->statement->database->value, $use->toString()] // => ['my db', 'USE `my db`']

Properties§

public Name $database

Methods§

public function __construct(public Name $database)

Parameters

$databaseNameThe database
public function deriveStatement(Derivation $derivation): void

Derives nothing: the statement returns no rows.

Parameters

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

Writes the statement.

Parameters

$outOutput
Calls 2

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
Type checks 1