final class Platform
Restricted visibility: declared "@visibility SqlSemantics". Code outside that scope must not name this declaration.

Wires the MySQL grammar releases, lowering rules and spelling rules into the analysis.

Rule: MYSQL-PROFILE-001. A profile is one shipped grammar release, the five lexical sql_mode settings, and the parameter style. The installed grammar and keyword artifacts must have the digests the release pins.

Rule: MYSQL-CONTEXT-001. An unqualified table name is searched in one database, the current database of the session; a context names it, and mysql is not assumed: without a search path the database is the name (current), which no qualified name written in SQL can equal by accident of spelling only if the caller never declares it, so callers that use qualified names give the real name. Table and database names are compared exactly, which is the server setting lower_case_table_names=0, the default on Unix; the setting is server configuration, the language profile has no field for it, and a server that runs with 1 or 2 needs the core profile to record it (see the family plan). Column names are compared without regard to ASCII letter case. The server folds every letter by the simple case mapping of its system character set, so two column names that differ only in the case of a letter outside ASCII are one name to the server and two names here; for names whose letters outside ASCII are written identically the comparison is exact. Source: https://dev.mysql.com/doc/refman/8.4/en/identifier-case-sensitivity.html. Status: Implemented.

Methods§

public function profile(
    ?string $version,
    ?Mode $mode,
    ParameterStyle $parameters,
): LanguageProfile

Fixes the profile of a shipped MySQL release under a session mode.

The release is named as the parser tags it (mysql-8.4.7) or by its number alone (8.4.7); without a release the default of the installed parser is used.

Parameters

$version?string
$mode?Mode
$parametersParameterStyle

Throws

InvalidArgumentException When the release is not shipped, the mode belongs to another database, or the installed grammar artifacts differ from the pinned ones
Test cases 515
Called from 1
Calls 10
public function parser(LanguageProfile $profile): SqlParser

Answers the parser of a profile, created once per profile.

Parameters

Returns

SqlParser
Test cases 245
Called from 1
Calls 8
public function productions(LanguageProfile $profile): Productions

Answers the productions of the release.

Parameters

Test cases 345
Called from 2
Calls 2
public function lower(Node $tree, LanguageProfile $profile, Leaves $leaves): list<Statement>

Lowers a parse tree into its statements.

Parameters

$treeNode
$profileLanguageProfile
$leavesLeaves

Returns

list<Statement>
Test cases 1
Called from 1
Calls 3
public function codec(LanguageProfile $profile): Codec

Answers the name codec of the release.

Parameters

Returns

Test cases 107
Calls 1
public function leafKeys(LanguageProfile $profile): LeafKeys

Answers the token comparison keys under the lexical settings of the profile.

Parameters

Returns

Test cases 1
Called from 1
Calls 1
public function context(
    LanguageProfile $profile,
    list<string>|null $searchPath,
    list<Table> $tables,
    bool $complete,
): AnalysisContext

Creates a context: one current database, exact table and database names, column names without regard to ASCII case.

Parameters

$profileLanguageProfile
$searchPathlist<string>|null
$tableslist<Table>
$completebool

Throws

InvalidArgumentException When the path names more than the current database
Test cases 104
Called from 2
Calls 7
public function statementNamespace(): string

Answers the namespace of the MySQL statement values.

Returns

string
Test cases 1
Called from 1

Private surface 2§

Implementation details, listed for orientation only.

private static ?self $shared = null
private array<string, SqlParser> $parsers = []

Test cases 517§

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

Dedicated tests 12
Other tests reaching this symbol 505

Relations§

Static calls 3
Method calls 8
Type declarations 1