Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

Take the CASE WHEN example from the blog. An equivalent EdgeQL expression is

  SELECT 'one' IF value = 1 ELSE 'not one'
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:

  {'one' if v = 1 else 'not one' for v in value}


Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: