classArityMismatch
final class ArityMismatch
implements Diagnostic
uses Snapshot
Public API: explicitly declared with
@visibility public.Two column counts that SQLite requires to agree and that differ.
$semantics = new \SqlSemantics\Platform\Sqlite\Semantics();
$table = $semantics->analyze('CREATE TABLE t (a INTEGER, b TEXT)');
$semantics->analyze('INSERT INTO t VALUES (1)', [$table]) // throws \SqlSemantics\Platform\Sqlite\Model\Diagnostic\SemanticException: 1 values for 2 columns.Properties§
public ArityRule $rulepublic int $expectedpublic int $actualMethods§
public function __construct(public ArityRule $rule, public int $expected, public int $actual)Parameters
$rule | ArityRule | The place where the counts must agree |
$expected | int | The count the place requires |
$actual | int | The count the statement supplies |
public function message(): stringDescribes the disagreement.
Returns
stringTest cases 1
Calls 8
- class-const ArityRule::CompoundArms() line 38
- class-const ArityRule::ValueRows() line 39
- class-const ArityRule::InsertedValues() line 40
- class-const ArityRule::CommonTableColumns() line 41
- class-const ArityRule::RowComparison() line 42
- class-const ArityRule::RowAssignment() line 43
- class-const ArityRule::ScalarSubquery() line 44
- class-const ArityRule::InListElement() line 45
Test cases 20§
Test cases that cover or call this symbol, from the coverage report and from the analyzed test sources.
Dedicated tests 2
Other tests reaching this symbol 18
RowValueUseTest::testElementsReportsTheFirstElementOfAnotherWidthOnlycallsRowValueUseTest::testMembershipReportsAnOperandOfAnotherWidthThanTheColumnscallsRowValueUseTest::testUniformReportsRowsOfDifferentWidthscallsInsertFactsTest::testDeriveCountsTheColumnsThatAreNotGeneratedWhenNoListIsWrittencallsInsertFactsTest::testDeriveCountsTheSourceColumnsAgainstTheTargetcallsMutationScopeTest::testAssignChecksTheColumnsAndTheWidthOfEachAssignmentcallsCommonTablesTest::testShapeRenamesTheColumnsByTheListAndReportsAnotherLengthcallsCompoundFactsTest::testCombinedTakesTheNamesOfTheFirstArmAndReportsAnotherWidthOncecallsBinaryTest::testDeriveScalarReportsRowsOfDifferentWidthscallsInListTest::testDeriveScalarReportsTheFirstValueOfAnotherWidthcallsInQueryTest::testDeriveScalarReportsAQueryOfAnotherWidthcallsInTableTest::testDeriveScalarReportsATableOfAnotherWidthcallsInsertRowsTest::testDeriveStatementCountsTheValuesAgainstTheColumnscallsInsertSelectTest::testDeriveStatementComparesTheQueryWidthWithTheColumnscallsRowAssignmentTest::testColumnsMustMatchTheWidthOfTheValuecallsCompoundTest::testDeriveQueryReportsArmsOfDifferentWidthOncecallsArityRuleTest::testCasesTellWhereTheCountsDisagreecallsValuesClauseTest::testDeriveQueryReportsARowOfAnotherWidthOncecalls
Relations§
Instantiated in 9
- new SqlSemantics\Platform\Sqlite\Rules\Expression\RowValueUse::uniform() packages/sql-semantics-sqlite/src/Rules/Expression/RowValueUse.php:79
- new SqlSemantics\Platform\Sqlite\Rules\Expression\RowValueUse::membership() packages/sql-semantics-sqlite/src/Rules/Expression/RowValueUse.php:89
- new SqlSemantics\Platform\Sqlite\Rules\Expression\RowValueUse::elements() packages/sql-semantics-sqlite/src/Rules/Expression/RowValueUse.php:104
- new SqlSemantics\Platform\Sqlite\Rules\Mutation\InsertFacts::derive() packages/sql-semantics-sqlite/src/Rules/Mutation/InsertFacts.php:66
- new SqlSemantics\Platform\Sqlite\Rules\Mutation\MutationScope::assign() packages/sql-semantics-sqlite/src/Rules/Mutation/MutationScope.php:96
- new SqlSemantics\Platform\Sqlite\Rules\Query\CommonTables::shape() packages/sql-semantics-sqlite/src/Rules/Query/CommonTables.php:136
- new SqlSemantics\Platform\Sqlite\Rules\Query\CompoundFacts::combined() packages/sql-semantics-sqlite/src/Rules/Query/CompoundFacts.php:113
- new SqlSemantics\Platform\Sqlite\Statement\Expression\Subquery\ScalarSubquery::deriveScalar() packages/sql-semantics-sqlite/src/Statement/Expression/Subquery/ScalarSubquery.php:59
- new SqlSemantics\Platform\Sqlite\Statement\Query\ValuesClause::deriveQuery() packages/sql-semantics-sqlite/src/Statement/Query/ValuesClause.php:84