packages/sql-semantics-mysql/src/Statement/Expression/Truth.php
1<?php
2
3declare(strict_types=1);
4
5namespace SqlSemantics\Platform\MySql\Statement\Expression;
6
7/**
8 * The truth values a truth test compares with: TRUE, FALSE and UNKNOWN.
9 *
10 * UNKNOWN is the truth value of NULL. Each case holds the keyword.
11 * Source: https://dev.mysql.com/doc/refman/8.4/en/comparison-operators.html#operator_is.
12 *
13 * @visibility public
14 * @example Reading the tested truth value
15 * $query = (new \SqlSemantics\Platform\MySql\Semantics())->analyze('SELECT a FROM t WHERE a IS NOT UNKNOWN');
16 * $query->statement->where->truth // => \SqlSemantics\Platform\MySql\Statement\Expression\Truth::Unknown
17 */
18enum Truth: string
19{
20 case True = 'TRUE';
21 case False = 'FALSE';
22 case Unknown = 'UNKNOWN';
23}
24