classKindProblem
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.
$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 tablenew \SqlSemantics\Platform\PostgreSql\Statement\Table\Problem\KindProblem(\SqlSemantics\Platform\PostgreSql\Statement\Table\Problem\KindRule::NotView, null) // throws \SqlSemantics\Platform\PostgreSql\Model\Diagnostic\InvalidConstructionnew \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\InvalidConstructionProperties§
public KindRule $rulepublic Name|null $relationpublic AlterAction|null $action = nullMethods§
public function __construct(
public KindRule $rule,
public Name|null $relation,
public AlterAction|null $action = null,
)Parameters
$rule | KindRule | The broken rule |
$relation | Name|null | The relation the command names, for the rules whose message names it |
$action | AlterAction|null | The ALTER action, for the rule that names one |
Calls 3
- static-call Check::input() line 35
- method-call KindRule::namesRelation() line 35
- class-const KindRule::AlterAction() line 36
public function message(): stringDescribes the broken rule in the words of PostgreSQL.
Returns
stringTest cases 2
Calls 1
- function-call
sprintfline 44
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
- new SqlSemantics\Platform\PostgreSql\Rules\Manipulation\CopyFacts::kind() packages/sql-semantics-postgres/src/Rules/Manipulation/CopyFacts.php:93
- new SqlSemantics\Platform\PostgreSql\Rules\Query\Locking::kinds() packages/sql-semantics-postgres/src/Rules/Query/Locking.php:109
- new SqlSemantics\Platform\PostgreSql\Rules\Query\Locking::kinds() packages/sql-semantics-postgres/src/Rules/Query/Locking.php:111
- new SqlSemantics\Platform\PostgreSql\Rules\Table\Command\AlterKinds::check() packages/sql-semantics-postgres/src/Rules/Table/Command/AlterKinds.php:93
- new SqlSemantics\Platform\PostgreSql\Rules\Table\Command\AlterKinds::parent() packages/sql-semantics-postgres/src/Rules/Table/Command/AlterKinds.php:128
- new SqlSemantics\Platform\PostgreSql\Rules\Table\Command\RewriteRules::derive() packages/sql-semantics-postgres/src/Rules/Table/Command/RewriteRules.php:46
- new SqlSemantics\Platform\PostgreSql\Rules\Table\RelationKinds::require() packages/sql-semantics-postgres/src/Rules/Table/RelationKinds.php:87
- new SqlSemantics\Platform\PostgreSql\Rules\Table\RelationKinds::modified() packages/sql-semantics-postgres/src/Rules/Table/RelationKinds.php:151
- new SqlSemantics\Platform\PostgreSql\Rules\Table\RelationKinds::foreign() packages/sql-semantics-postgres/src/Rules/Table/RelationKinds.php:176
- new SqlSemantics\Platform\PostgreSql\Rules\Table\RelationKinds::triggered() packages/sql-semantics-postgres/src/Rules/Table/RelationKinds.php:200