classExists
final class Exists
implements Scalar
uses Snapshot
Public API: explicitly declared with
@visibility public.A test whether a query returns at least one row.
Rule: SQLITE-EXISTS-001. The query is derived inside the environment of the expression. The result is the INTEGER 0 or 1 and never NULL. Source: https://sqlite.org/lang_expr.html#the_exists_operator. Status: Implemented.
$query = (new \SqlSemantics\Platform\Sqlite\Semantics())->analyze('SELECT EXISTS (SELECT 1 FROM t)');
[$query->field(0)->type->descriptor, $query->field(0)->nullability] // => [\SqlSemantics\Platform\Sqlite\Statement\Type\Storage::Integer, \SqlSemantics\Platform\Sqlite\Model\Statement\Type\Nullability::NotNull]Properties§
public Query $queryMethods§
public function deriveScalar(Derivation $derivation, Environment $environment): ScalarFactDerives the query; the test is an INTEGER that is never NULL.
Parameters
$derivation | Derivation | |
$environment | Environment |
Returns
Calls 5
- method-call Derivation::query() line 46
- new ScalarFact line 48
- new Known line 48
- class-const Storage::Integer() line 48
- class-const Nullability::NotNull() line 48
public function render(Output $out): voidTest cases 5§
Test cases that cover or call this symbol, from the coverage report and from the analyzed test sources.