final class ArityMismatch
    implements Diagnostic
    uses Snapshot
Public API: explicitly declared with @visibility public.

Two column counts that PostgreSQL requires to agree differ.

Reporting arms of different widthsdoctest
(new \SqlSemantics\Platform\PostgreSql\Semantics())->analyze('SELECT 1 UNION SELECT 1, 2') // throws \SqlSemantics\Platform\PostgreSql\Model\Diagnostic\SemanticException: each UNION query must have the same number of columns
Refusing equal countsdoctest
new \SqlSemantics\Platform\PostgreSql\Statement\Query\Problem\ArityMismatch(\SqlSemantics\Platform\PostgreSql\Statement\Query\Problem\ArityRule::ValuesRows, 'VALUES', 2, 2) // throws \SqlSemantics\Platform\PostgreSql\Model\Diagnostic\InvalidConstruction

Properties§

public ArityRule $rule
public string $subject
public int $available
public int $specified

Methods§

public function __construct(
    public ArityRule $rule,
    public string $subject,
    public int $available,
    public int $specified,
)

Parameters

$ruleArityRuleThe rule that requires the counts to agree
$subjectstringThe operator or relation name the message names
$availableintThe count the first part has
$specifiedintThe count the other part has
Calls 1
public function message(): string

Describes the problem in the words of PostgreSQL.

Returns

string
Calls 1

Test cases 1§

Test cases that cover or call this symbol, from the coverage report and from the analyzed test sources.

Dedicated tests 1

Relations§

Instantiated in 5