final class SqlNames
Public API: explicitly declared with @visibility public.

Spells decoded names as SQL of a fixed language profile, for SQL text a caller assembles and analyzes again.

The codec encodes names for a position. It is not a general escaping function: it does not spell values, expressions or statements, and SQL assembled with its help is unchecked until it is analyzed.

Spelling a relation name read from one query for another statementdoctest
$semantics = new \SqlSemantics\Platform\MySql\Semantics();
    $input = $semantics->analyze('SELECT a FROM `order items`')->singleNamedInput();
    $table = \SqlSemantics\Platform\MySql\SqlNames::table($input->name(), $semantics->profile());
    $semantics->analyze("SELECT * FROM {$table}")->singleNamedInput()->name()->name->value // => 'order items'

Methods§

public static function table(QualifiedName $name, LanguageProfile $profile): string

Spells a decoded, optionally qualified relation name for a relation name position.

Parameters

Returns

string
Test cases 1
Calls 4

Test cases 1§

Test cases that cover or call this symbol, from the coverage report and from the analyzed test sources.

Dedicated tests 1