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

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

Rule: PG-PROFILE-001. A profile fixes one shipped grammar release with standard_conforming_strings = on and a UTF-8 server encoding; PostgreSQL has no session mode that changes how its grammar reads text otherwise. An unquoted identifier is folded to lower case when it is decoded, so names are compared exactly afterwards. An unqualified relation name is searched in the temporary schema, then pg_catalog, then the schemas of the search path, unless the path lists those two itself. Source: https://www.postgresql.org/docs/17/sql-syntax-lexical.html#SQL-SYNTAX-IDENTIFIERS, https://www.postgresql.org/docs/17/runtime-config-client.html#GUC-SEARCH-PATH. Status: Implemented.

Methods§

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

Fixes the profile of a shipped PostgreSQL release; PostgreSQL reads SQL under no session mode.

Parameters

$version?string
$mode?Mode
$parametersParameterStyle

Throws

InvalidArgumentException When the release is not shipped, a mode is given, or the installed grammar artifacts differ from the pinned ones
Test cases 2
Called from 1
Calls 10
public function parser(LanguageProfile $profile): SqlParser
public function productions(LanguageProfile $profile): Productions

Answers the productions of the release.

Parameters

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

Answers the name codec.

Parameters

Returns

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

Creates a context: the temporary schema and pg_catalog are searched before the path unless the path names them, and names compare exactly.

Parameters

$profileLanguageProfile
$searchPathlist<string>|null
$tableslist<Table>
$completebool
Test cases 304
Called from 2
Calls 4
public function statementNamespace(): string

Answers the namespace of the PostgreSQL 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 868§

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

Dedicated tests 11
Other tests reaching this symbol 857

Relations§

Static calls 3
Method calls 8
Type declarations 1