classTableProblems
final class TableProblems
Reports the problems of a table definition that follow from the definition alone.
Rule: SQLITE-TABLE-PROBLEMS-001. Diagnostics: a TEMP object qualified with another schema than temp; a repeated column name; an unknown table option; in a STRICT table a column without one of the six standard types; more than one primary key; a WITHOUT ROWID table without a primary key; AUTOINCREMENT on a key that is not an integer primary key, or on a WITHOUT ROWID table; a generated column in the primary key; a table whose columns are all generated. Problems SQLite finds only when rows are written, and limits of the library build, are not modeled. Terminates: the column pairs and the options are finite. Source: https://sqlite.org/lang_createtable.html, https://sqlite.org/stricttables.html, https://sqlite.org/withoutrowid.html, https://sqlite.org/autoinc.html, https://sqlite.org/gencol.html#limitations. Status: Implemented.
Methods§
public function report(
CreateTable $definition,
list<ColumnDomain> $domains,
TableKey $key,
Derivation $derivation,
): voidReports every problem of a table definition.
Parameters
$definition | CreateTable | |
$domains | list<ColumnDomain> | The declared type of each column, in column order |
$key | TableKey | |
$derivation | Derivation |
Called from 1
Calls 13
- method-call TableProblems::temporary() line 48
- method-call TableProblems::duplicates() line 49
- method-call Derivation::report() line 52
- new UnknownTableOption line 52
- method-call CreateTable::strict() line 55
- new StrictTypeViolation line 57
- class-const PrimaryKeyFlaw::Repeated() line 61
- method-call CreateTable::withoutRowid() line 62
- class-const PrimaryKeyFlaw::MissingWithoutRowid() line 62
- class-const PrimaryKeyFlaw::AutoincrementNotIntegerKey() line 63
- class-const PrimaryKeyFlaw::AutoincrementWithoutRowid() line 64
- new PrimaryKeyProblem line 68
- method-call TableProblems::generated() line 71
public function generated(CreateTable $definition, TableKey $key, Derivation $derivation): voidReports a generated column in the primary key and a table without a plain column.
Parameters
$definition | CreateTable | |
$key | TableKey | |
$derivation | Derivation |
Called from 1
Calls 5
- function-call
in_arrayline 83 - method-call Derivation::report() line 84
- new GeneratedColumnProblem line 84
- class-const GeneratedColumnFlaw::InPrimaryKey() line 84
- class-const GeneratedColumnFlaw::NoPlainColumn() line 88
public function temporary(QualifiedName $name, bool $temporary, Derivation $derivation): voidReports a TEMP object whose name is qualified with another schema than temp.
Parameters
$name | QualifiedName | |
$temporary | bool | |
$derivation | Derivation |
Test cases 1
Called from 3
- method-call SqlSemantics\Platform\Sqlite\Rules\Definition\TableProblems::report() packages/sql-semantics-sqlite/src/Rules/Definition/TableProblems.php:48
- method-call SqlSemantics\Platform\Sqlite\Statement\Schema\CreateTableAs::deriveStatement() packages/sql-semantics-sqlite/src/Statement/Schema/CreateTableAs.php:64
- method-call SqlSemantics\Platform\Sqlite\Statement\Schema\CreateView::deriveStatement() packages/sql-semantics-sqlite/src/Statement/Schema/CreateView.php:76
Calls 2
- method-call Derivation::report() line 98
- new QualifiedTemporaryName line 98
public function duplicates(list<ColumnDefinition> $columns, Derivation $derivation): voidReports each column whose name an earlier column already has.
Parameters
$columns | list<ColumnDefinition> | |
$derivation | Derivation |
Test cases 1
Called from 1
Calls 3
- function-call
array_sliceline 110 - method-call Derivation::report() line 112
- new DuplicateColumn line 112
Test cases 2§
Test cases that cover or call this symbol, from the coverage report and from the analyzed test sources.
Relations§
Instantiated in 3
- new SqlSemantics\Platform\Sqlite\Statement\Schema\CreateTable::deriveRelation() packages/sql-semantics-sqlite/src/Statement/Schema/CreateTable.php:154
- new SqlSemantics\Platform\Sqlite\Statement\Schema\CreateTableAs::deriveStatement() packages/sql-semantics-sqlite/src/Statement/Schema/CreateTableAs.php:64
- new SqlSemantics\Platform\Sqlite\Statement\Schema\CreateView::deriveStatement() packages/sql-semantics-sqlite/src/Statement/Schema/CreateView.php:76
Method calls 3
- method-call SqlSemantics\Platform\Sqlite\Statement\Schema\CreateTable::deriveRelation() packages/sql-semantics-sqlite/src/Statement/Schema/CreateTable.php:154
- method-call SqlSemantics\Platform\Sqlite\Statement\Schema\CreateTableAs::deriveStatement() packages/sql-semantics-sqlite/src/Statement/Schema/CreateTableAs.php:64
- method-call SqlSemantics\Platform\Sqlite\Statement\Schema\CreateView::deriveStatement() packages/sql-semantics-sqlite/src/Statement/Schema/CreateView.php:76