classWrongRelationKind
final class WrongRelationKind
implements Diagnostic
uses Snapshot
Public API: explicitly declared with
@visibility public.A request SQLite refuses because the relation it names is of another kind.
Source: https://sqlite.org/lang_dropview.html, https://sqlite.org/lang_createtrigger.html#instead_of_triggers.
$semantics = new \SqlSemantics\Platform\Sqlite\Semantics();
$view = $semantics->analyze('CREATE VIEW v AS SELECT 1');
$semantics->analyze('DROP TABLE v', [$view]) // throws \SqlSemantics\Platform\Sqlite\Model\Diagnostic\SemanticException: Relation v is a view: DROP TABLE removes only a table.Properties§
public Table $relationpublic KindRefusal $refusalMethods§
public function __construct(public Table $relation, public KindRefusal $refusal)Parameters
$relation | Table | The declaration the name resolved to |
$refusal | KindRefusal | The request and the kind it needs |
Throws
InvalidConstruction When the relation is of the kind the request needsCalls 2
- static-call Check::input() line 35
- method-call KindRefusal::required() line 35
public function message(): stringDescribes the problem.
Returns
stringTest cases 1
Calls 5
- class-const RelationKind::BaseTable() line 44
- class-const RelationKind::View() line 45
- class-const RelationKind::MaterializedView() line 46
- class-const RelationKind::ForeignTable() line 47
- class-const RelationKind::Sequence() line 48
Test cases 4§
Test cases that cover or call this symbol, from the coverage report and from the analyzed test sources.