classSqlNames
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.
$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): stringSpells a decoded, optionally qualified relation name for a relation name position.
Parameters
$name | QualifiedName | |
$profile | LanguageProfile |
Returns
stringTest cases 1
Calls 4
- static-call Platform::shared() line 32
- class-const NameUse::Qualifier() line 35
- class-const NameUse::Relation() line 40
- function-call
implodeline 42
Test cases 1§
Test cases that cover or call this symbol, from the coverage report and from the analyzed test sources.