From df7f1fb0512303b3bde6d7190321b20780b743af Mon Sep 17 00:00:00 2001 From: Simon Binder Date: Sun, 25 Apr 2021 15:12:55 +0200 Subject: [PATCH] Docs: Update isNull / isNotNull --- docs/pages/docs/Advanced Features/expressions.md | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/docs/pages/docs/Advanced Features/expressions.md b/docs/pages/docs/Advanced Features/expressions.md index a35968da..0c99a81c 100644 --- a/docs/pages/docs/Advanced Features/expressions.md +++ b/docs/pages/docs/Advanced Features/expressions.md @@ -63,9 +63,14 @@ String expressions define a `+` operator as well. Just like you would expect, it concatenation in sql. ## Nullability -To check whether an expression returns null, you can use the top-level `isNull` function, -which takes any expression and returns a boolean expression. The expression returned will -resolve to `true` if the inner expression resolves to null and `false` otherwise. +To check whether an expression evaluates to `NULL` in sql, you can use the `isNull` extension: + +```dart +final withoutCategories = select(todos)..where((row) => row.category.isNull()); +``` + +The expression returned will resolve to `true` if the inner expression resolves to null +and `false` otherwise. As you would expect, `isNotNull` works the other way around. To use a fallback value when an expression evaluates to `null`, you can use the `coalesce`