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

Spells a decoded PostgreSQL name so that it decodes to the same name at its position.

Rule: PG-NAME-CODEC-001. A name is written without quotes only when it is a lower-case word of ASCII letters, digits, _ and $ that does not start with a digit or $, and the grammar reads that word as a name at the position: a keyword must belong to a category the position accepts. Anything else is written between double quotes with each quote doubled, which the server reads literally. The empty name, a name containing a zero byte and a name longer than the server stores cannot be spelled and are rejected. Source: https://www.postgresql.org/docs/17/sql-syntax-lexical.html#SQL-SYNTAX-IDENTIFIERS. Status: Implemented.

Methods§

public function __construct(private GrammarRelease $release)

Parameters

$releaseGrammarReleaseThe grammar release whose keywords decide quoting
public function name(Name $name, NameUse $use): string

Spells a decoded name for a position, quoting only as the grammar requires.

Parameters

$nameName
$useNameUse

Returns

string
Test cases 4
Calls 8

Private surface 1§

Implementation details, listed for orientation only.

private GrammarRelease $release

Test cases 256§

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

Dedicated tests 4
Other tests reaching this symbol 252

Relations§

Instantiated in 1
Type declarations 1