Comment by jeffdavis
7 years ago
The {} construct seems awfully close to NULL. Not sure I understand the fundamental difference -- having a third value in boolean contexts still introduces 3VL.
Why not just use an Option/Maybe type?
7 years ago
The {} construct seems awfully close to NULL. Not sure I understand the fundamental difference -- having a third value in boolean contexts still introduces 3VL.
Why not just use an Option/Maybe type?
Empty set differs from NULL is that you get an empty set if you apply an element-wise function over it (which most operators and functions in EdgeQL are).
> Why not just use an Option/Maybe type?
We are considering adding algebraic types and a syntax to match them, but it ultimately boils down to taste and use case:
is not fundamentally different from (hypothetical):
"Empty set differs from NULL is that you get an empty set if you apply an element-wise function over it"
It still sounds like NULL -- I must be missing something.
Take the CASE WHEN example from the blog. An equivalent EdgeQL expression is
If value is an empty set, then the result is _always_ an empty set, unlike SQL that pretends NULL values are actually boolean for the purposes of the condition. EdgeQL expressions are, essentially, set comprehensions, the above is equivalent to this Python expression: