final class InQuery
    implements Scalar
    uses Snapshot
Public API: explicitly declared with @visibility public.

A membership test against the rows of a query, optionally negated.

Rule: SQLITE-IN-QUERY-001. The query is derived inside the environment of the expression. The result is INTEGER; it can be NULL when the operand or a compared column can be, and it depends on the missing inputs when the shape of the query is open. The query returns as many columns as the operand has values (SQLITE-ROW-VALUE-USE-001). The operand may not end in an operator weaker than the equality group (SQLITE-PRECEDENCE-001). Source: https://sqlite.org/lang_expr.html#the_in_and_not_in_operators. Status: Implemented.

Reading a membership test against a querydoctest
$query = (new \SqlSemantics\Platform\Sqlite\Semantics())->analyze('SELECT 1 IN (SELECT 2)');
    [$query->statement->columns[0]->expression->negated, $query->field(0)->nullability] // => [false, \SqlSemantics\Platform\Sqlite\Model\Statement\Type\Nullability::NotNull]

Properties§

public Scalar $operand
public Query $query
public bool $negated = false

Methods§

public function __construct(
    public Scalar $operand,
    public Query $query,
    public bool $negated = false,
)

Parameters

$operandScalarThe tested expression
$queryQueryThe query
$negatedboolWhether NOT is written before IN
Calls 4
public function deriveScalar(Derivation $derivation, Environment $environment): ScalarFact

Derives the operand, the query and the result.

Parameters

$derivationDerivation
$environmentEnvironment

Returns

Calls 9
public function render(Output $out): void

Writes the test.

Parameters

$outOutput
Calls 2

Test cases 6§

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

Dedicated tests 4
Other tests reaching this symbol 2

Relations§

Instantiated in 1
Type checks 2