final class KindProblem
    implements Diagnostic
    uses Snapshot
Public API: explicitly declared with @visibility public.

A command that names a relation of a kind it does not accept, as the declaration of the relation states it.

Reading the problem of a TRUNCATE of a viewdoctest
$semantics = new \SqlSemantics\Platform\PostgreSql\Semantics();
    $semantics->analyze('TRUNCATE v', [$semantics->analyze('CREATE VIEW v AS SELECT 1 AS a')]) // throws \SqlSemantics\Platform\PostgreSql\Model\Diagnostic\SemanticException: "v" is not a table
Refusing a problem without the relation its message namesdoctest
new \SqlSemantics\Platform\PostgreSql\Statement\Table\Problem\KindProblem(\SqlSemantics\Platform\PostgreSql\Statement\Table\Problem\KindRule::NotView, null) // throws \SqlSemantics\Platform\PostgreSql\Model\Diagnostic\InvalidConstruction
Refusing an action for a rule that names nonedoctest
new \SqlSemantics\Platform\PostgreSql\Statement\Table\Problem\KindProblem(\SqlSemantics\Platform\PostgreSql\Statement\Table\Problem\KindRule::NotView, new \SqlSemantics\Platform\PostgreSql\Model\Statement\Identifier\Name('t'), \SqlSemantics\Platform\PostgreSql\Statement\Table\Problem\AlterAction::AddColumn) // throws \SqlSemantics\Platform\PostgreSql\Model\Diagnostic\InvalidConstruction

Properties§

public KindRule $rule
public Name|null $relation
public AlterAction|null $action = null

Methods§

public function __construct(
    public KindRule $rule,
    public Name|null $relation,
    public AlterAction|null $action = null,
)

Parameters

$ruleKindRuleThe broken rule
$relationName|nullThe relation the command names, for the rules whose message names it
$actionAlterAction|nullThe ALTER action, for the rule that names one
Calls 3
public function message(): string

Describes the broken rule in the words of PostgreSQL.

Returns

string
Test cases 2
Calls 1

Test cases 3§

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

Dedicated tests 3

Relations§

Instantiated in 10