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

Lowers the maintenance commands, EXPLAIN and LOCK.

Rule: PG-MAINTENANCE-LOWER-001. Scope: VacuumStmt, AnalyzeStmt, vacuum_relation, vacuum_relation_list, opt_vacuum_relation_list, ClusterStmt, cluster_index_specification, ReindexStmt, reindex_target_relation, reindex_target_all, opt_reindex_option_list, CheckPointStmt, ExplainStmt, ExplainableStmt, LockStmt, opt_lock, lock_type. Constructors: Vacuum, Analyze, MaintenanceTarget, Cluster, Reindex, Checkpoint, Explain, Lock. The options are lowered by PG-UTILITY-OPTION-LOWER-001; the explained statement by the family that owns it, through the hub. Termination: lists are flattened iteratively; the explained statement is a proper part of the tree. Source: https://www.postgresql.org/docs/17/sql-vacuum.html, https://www.postgresql.org/docs/17/sql-analyze.html, https://www.postgresql.org/docs/17/sql-cluster.html, https://www.postgresql.org/docs/17/sql-reindex.html, https://www.postgresql.org/docs/17/sql-checkpoint.html, https://www.postgresql.org/docs/17/sql-explain.html, https://www.postgresql.org/docs/17/sql-lock.html. Status: Implemented.

Methods§

public function __construct(private Lowering $lowering)

Parameters

$loweringLoweringThe hub
public function lock(Node $word, Node $relations, Node $mode, Node $nowait): Lock

Lowers the parts of LockStmt; the optional word TABLE is noise.

Parameters

$wordNode
$relationsNode
$modeNode
$nowaitNode

Returns

Throws

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

Private surface 4§

Implementation details, listed for orientation only.

private const EXPLAINABLE = ['ExplainableStmt: SelectStmt', 'ExplainableStmt: InsertStmt', 'ExplainableStmt…
private const MODES = ['lock_type: ACCESS SHARE' => \SqlSemantics\Platform\PostgreSql\Statement\Utili…
private const REBUILT = ['reindex_target_relation: INDEX' => \SqlSemantics\Platform\PostgreSql\Statemen…
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 1
Method calls 1