classRefreshMaterializedView
final class RefreshMaterializedView
implements Statement, Relation
uses Snapshot
@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.
(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 QualifiedName $namepublic bool $concurrently = falsepublic bool|null $withData = nullMethods§
public function __construct(
public QualifiedName $name,
public bool $concurrently = false,
public bool|null $withData = null,
)Parameters
$name | QualifiedName | The materialized view |
$concurrently | bool | Whether CONCURRENTLY is written |
$withData | bool|null | True for WITH DATA, false for WITH NO DATA, null when not written |
public function deriveStatement(Derivation $derivation): voidResolves 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
$derivation | Derivation |
Calls 9
- new RelationKinds line 56
- method-call RelationKinds::of() line 57
- method-call Derivation::relation() line 57
- method-call Derivation::environment() line 57
- method-call RelationKinds::require() line 58
- class-const RelationKind::MaterializedView() line 58
- class-const RelationKind::BaseTable() line 58
- class-const KindRule::NotMaterializedView() line 58
- class-const KindRule::NotTableOrMaterializedView() line 58
public function deriveRelation(Derivation $derivation, Environment $environment): RelationFactResolves the view and answers its facts.
Parameters
$derivation | Derivation | |
$environment | Environment |
Returns
Calls 2
- method-call Targets::resolve() line 66
- new Targets line 66
public function render(Output $out): voidWrites the statement.
Parameters
$out | Output |
Calls 5
- method-call Output::keyword() line 74
- method-call Spelling::qualified() line 78
- new Spelling line 78
- method-call Writing::withData() line 79
- new Writing line 79
Test cases 2§
Test cases that cover or call this symbol, from the coverage report and from the analyzed test sources.