classUnknownColumn
final class UnknownColumn
implements Diagnostic
uses Snapshot
Public API: explicitly declared with
@visibility public.A column name in a definition or alteration that the completely known table does not have.
It is reported for the child columns of a foreign key and for the column that ALTER TABLE drops or renames. A name inside an expression is reported by the expression itself as a missing column. Source: https://sqlite.org/lang_altertable.html, https://sqlite.org/foreignkeys.html.
$semantics = new \SqlSemantics\Platform\Sqlite\Semantics();
$table = $semantics->analyze('CREATE TABLE t (a, b)');
$semantics->analyze('ALTER TABLE t DROP COLUMN c', [$table]) // throws \SqlSemantics\Platform\Sqlite\Model\Diagnostic\SemanticException: Column c does not exist in the table.Properties§
public Name $columnMethods§
public function __construct(public Name $column)Parameters
$column | Name | The name that denotes no column |
public function message(): stringTest cases 6§
Test cases that cover or call this symbol, from the coverage report and from the analyzed test sources.
Dedicated tests 1
Other tests reaching this symbol 5
AlterationProblemsTest::testDroppedReportsAnUnknownColumnAndTheOnlyColumncallsAlterationProblemsTest::testRenamedReportsAnUnknownOldNameAndATakenNewNamecallsAlterDropColumnTest::testDeriveStatementReportsAColumnTheTableDoesNotHavecallsAlterRenameColumnTest::testDeriveStatementReportsAnUnknownOldNameAndATakenNewNamecallsForeignKeyTest::testDeriveConstraintReportsAChildColumnTheTableDoesNotHavecalls
Relations§
Instantiated in 3
- new SqlSemantics\Platform\Sqlite\Rules\Definition\AlterationProblems::dropped() packages/sql-semantics-sqlite/src/Rules/Definition/AlterationProblems.php:134
- new SqlSemantics\Platform\Sqlite\Rules\Definition\AlterationProblems::renamed() packages/sql-semantics-sqlite/src/Rules/Definition/AlterationProblems.php:146
- new SqlSemantics\Platform\Sqlite\Statement\Schema\Table\ForeignKey::deriveConstraint() packages/sql-semantics-sqlite/src/Statement/Schema/Table/ForeignKey.php:62