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

Lowers the configuration commands: SET, RESET, SHOW, ALTER SYSTEM, SET CONSTRAINTS and DISCARD.

Rule: PG-SETTING-LOWER-001. Scope: VariableSetStmt, set_rest, generic_set, set_rest_more, zone_value, opt_encoding, VariableResetStmt, reset_rest, generic_reset, SetResetClause, FunctionSetResetClause, VariableShowStmt, AlterSystemStmt, ConstraintsSetStmt, constraints_set_list, constraints_set_mode, DiscardStmt. Constructors: SetParameter, SetParameterFrom, SetTimeZone, SetSpecialSetting, SetTransaction, Reset, Show, AlterSystemSetting, SetConstraints, Discard. TO and =, and SESSION after SET, are noise (UtilityNoise). Termination: one pass; lists are flattened iteratively. Source: https://www.postgresql.org/docs/17/sql-set.html, https://www.postgresql.org/docs/17/sql-reset.html, https://www.postgresql.org/docs/17/sql-show.html, https://www.postgresql.org/docs/17/sql-altersystem.html, https://www.postgresql.org/docs/17/sql-set-constraints.html, https://www.postgresql.org/docs/17/sql-discard.html. Status: Implemented.

Methods§

public function __construct(private Lowering $lowering)

Parameters

$loweringLoweringThe hub
public function clause(Node $clause): Statement

Lowers SetResetClause or FunctionSetResetClause: the SET or RESET attached to a role, a database or a routine.

Parameters

$clauseNode

Returns

Throws

ImplementationGap When the production has no rule
Called from 1
Calls 4
public function names(Node $encoding, bool $local): SetSpecialSetting

Lowers SET NAMES with its opt_encoding.

Parameters

$encodingNode
$localbool

Throws

ImplementationGap When the production has no rule
Called from 1
Calls 3
public function constraints(Node $list): list<QualifiedName>

Lowers constraints_set_list; ALL is no name.

Parameters

$listNode

Returns

Throws

ImplementationGap When the production has no rule
Called from 1
Calls 1
public function deferred(Node $mode): bool

Lowers constraints_set_mode: whether checking is deferred.

Parameters

$modeNode

Returns

bool

Throws

ImplementationGap When the production has no rule
Called from 1
Calls 1

Private surface 3§

Implementation details, listed for orientation only.

private const SPECIAL = ['reset_rest: TIME ZONE' => \SqlSemantics\Platform\PostgreSql\Statement\Utility…
private const DISCARDED = ['DiscardStmt: DISCARD ALL' => \SqlSemantics\Platform\PostgreSql\Statement\Util…
private Lowering $lowering

Test cases 1§

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

Dedicated tests 1

Relations§

Instantiated in 2
Method calls 2