packages/sql-semantics-postgres/src/Statement/Expression/Subquery/Quantifier.php

1<?php
2
3declare(strict_types=1);
4
5namespace SqlSemantics\Platform\PostgreSql\Statement\Expression\Subquery;
6
7/**
8 * The quantifier of a comparison with a set of values: ANY, its synonym SOME, or ALL.
9 *
10 * ANY and SOME request the same test; the grammar keeps the word.
11 * Source: https://www.postgresql.org/docs/17/functions-subquery.html.
12 *
13 * @visibility public
14 * @example Reading the quantifier
15 *     $query = (new \SqlSemantics\Platform\PostgreSql\Semantics())->analyze('SELECT 1 = SOME (SELECT 1)');
16 *     $query->field(0)->expression->quantifier // => \SqlSemantics\Platform\PostgreSql\Statement\Expression\Subquery\Quantifier::Some
17 */
18enum Quantifier: string
19{
20    /**
21     * `ANY`: true when the comparison holds for some value.
22     */
23    case Any = 'ANY';
24
25    /**
26     * `SOME`, a synonym of ANY.
27     */
28    case Some = 'SOME';
29
30    /**
31     * `ALL`: true when the comparison holds for every value.
32     */
33    case All = 'ALL';
34}
35