final class RefreshMaterializedView
    implements Statement, Relation
    uses Snapshot
Public API: explicitly declared with @visibility public.

A request to replace the rows of a materialized view.

Mirrors PostgreSQL's RefreshMatViewStmt (concurrent, skipData, relation). The view is resolved (PG-TABLE-TARGET-001) and is the relation fact of the statement; the statement changes no declaration. A relation declared as another kind is reported (PG-RELATION-KIND-001). Source: https://www.postgresql.org/docs/17/sql-refreshmaterializedview.html.

Resolving the refreshed viewdoctest
(new \SqlSemantics\Platform\PostgreSql\Semantics())->analyze('REFRESH MATERIALIZED VIEW CONCURRENTLY m WITH DATA', []) // throws \SqlSemantics\Platform\PostgreSql\Model\Diagnostic\SemanticException: Relation m does not exist.

Properties§

public bool $concurrently = false
public bool|null $withData = null

Methods§

public function __construct(
    public QualifiedName $name,
    public bool $concurrently = false,
    public bool|null $withData = null,
)

Parameters

$nameQualifiedNameThe materialized view
$concurrentlyboolWhether CONCURRENTLY is written
$withDatabool|nullTrue for WITH DATA, false for WITH NO DATA, null when not written
public function deriveStatement(Derivation $derivation): void

Resolves the view and reports a relation that is declared as another kind (PG-RELATION-KIND-001).

A table passes the lookup and is then refused as not a materialized view; a view, a sequence or a foreign table is refused by the lookup.

Parameters

$derivationDerivation
Calls 9
public function deriveRelation(Derivation $derivation, Environment $environment): RelationFact

Resolves the view and answers its facts.

Parameters

$derivationDerivation
$environmentEnvironment
Calls 2
public function render(Output $out): void

Writes the statement.

Parameters

$outOutput
Calls 5

Test cases 2§

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

Dedicated tests 2

Relations§

Instantiated in 1
Type declarations 1