Skip to content

Commit

Permalink
Some more review comments
Browse files Browse the repository at this point in the history
  • Loading branch information
simolus3 committed Nov 1, 2024
1 parent 3feef7e commit 9139660
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 8 deletions.
13 changes: 6 additions & 7 deletions docs/docs/dart_api/expressions.md
Original file line number Diff line number Diff line change
Expand Up @@ -78,19 +78,18 @@ bitwise operations:

### BigInt

You may want to cast an expression to a `BigInt` if:

- The result of an arithmetic operation will be extremely large[^1].
- You are compiling to JavaScript.

[^1]: Like bigger than 4,503,599,627,370,496!
While SQLite and the Dart VM use 64-bit integers, Dart applications compiled to JavaScript
don't.
So, [to represent large integer results](tables.md#when-to-use-bigint-and-int64) when compiling
to the web, you may want to cast an expression to a `BigInt`.

Using `dartCast<BigInt>()` will ensure that the result is interpreted as a `BigInt` by drift.
This doesn't change the generated SQL, drift uses a 64-bit integer type for all databases.

**Example:**
For an expression `(table.columnA * table.columnB).dartCast<BigInt>()`, drift will report the resulting value as a `BigInt` even if `columnA` and `columnB` were defined as regular integers.

## Null checks
## Null checks
To check whether an expression evaluates to `NULL` in SQL, you can use the `isNull` extension:

```dart
Expand Down
2 changes: 1 addition & 1 deletion docs/docs/dart_api/manager.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
---

title: Queries
title: Manager
description: Use easier bindings for common queries.

---
Expand Down

0 comments on commit 9139660

Please sign in to comment.