Boolean Type

type
bool

A boolean type with possible values of true and false.

EdgeQL has case-insensitive keywords and that includes the boolean literals:

Copy
db> 
SELECT (True, true, TRUE);
{(true, true, true)}
Copy
db> 
SELECT (False, false, FALSE);
{(false, false, false)}

A boolean value may arise as a result of a logical or comparison operations as well as IN and NOT IN:

Copy
db> 
SELECT true AND 2 < 3;
{true}
Copy
db> 
SELECT '!' IN {'hello', 'world'};
{false}

It is also possible to cast between bool, str, and json:

Copy
db> 
SELECT <json>true;
{'true'}
Copy
db> 
SELECT <bool>'True';
{true}

Filter clauses must always evaluate to a boolean:

Copy
SELECT User
FILTER .name ILIKE 'alice';

Scalar type SDL, DDL, introspection, and boolean operators.

Light
Dark
System