classUseDatabase
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.
$use = (new \SqlSemantics\Platform\MySql\Semantics())->analyze('use `my db`');
[$use->statement->database->value, $use->toString()] // => ['my db', 'USE `my db`']Properties§
public Name $databaseMethods§
public function deriveStatement(Derivation $derivation): voidDerives nothing: the statement returns no rows.
Parameters
$derivation | Derivation |
public function render(Output $out): voidWrites the statement.
Parameters
$out | Output |
Calls 2
- method-call Output::keyword() line 51
- class-const NameUse::Qualifier() line 51
Test cases 1§
Test cases that cover or call this symbol, from the coverage report and from the analyzed test sources.