2 ms·
This goes a bit beyond what fits in a comment reply, but I'll try to be brief. - You can define a `bool` property as "optional" and then it can have an empty s
by 1st1 8y ago
This goes a bit beyond what fits in a comment reply, but I'll try to be brief.
- You can define a `bool` property as "optional" and then it can have an empty set as its value.
- The 'exists' operator coverts sets into bools; you can use it with the 'if..else' operator to handle empty sets where needed.
- You can coalesce (the "??" operator) your potentially empty property with a non-empty set, say a "{false}".
- An empty set isn't some magical value like NULL in SQL. Functions and operators in EdgeQL are strictly defined if they accept sets as their arguments, or not. In the case of logical operators -- they don't; they are defined as element-wise operators, therefore no three-valued boolean logic. You learn the rules once and they apply to all functions and operators in all contexts.
This documentation page (and subsequent sections) explains how exactly EdgeQL is defined: https://edgedb.com/docs/edgeql/overview https://edgedb.com/docs/edgeql/overview.