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

A request to change the definition of an existing view.

Rule: MYSQL-ALTER-VIEW-001. The view name is a table use: the statement node records its resolution as a target; a declared base table is refused (MYSQL-RELATION-KIND-001). The new query is derived and checked as for CREATE VIEW (MYSQL-VIEW-FACTS-001), but an ALTER provides no declaration: it requests a change and does not change a context. Source: https://dev.mysql.com/doc/refman/8.4/en/alter-view.html. Status: Implemented.

Reading the new query of a viewdoctest
$view = (new \SqlSemantics\Platform\MySql\Semantics())->analyze('ALTER VIEW v AS SELECT 1 AS a');
    [$view->statement->definition->name->name->value, $view->declarations()] // => ['v', []]

Properties§

public ViewDefinition $definition

Methods§

public function __construct(public ViewDefinition $definition)

Parameters

$definitionViewDefinitionThe new view definition
public function deriveStatement(Derivation $derivation): void

Resolves the view and derives its new query.

Parameters

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

Writes the statement.

Parameters

$outOutput
Calls 2

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
Type checks 1
Type declarations 1