Skip to content

Commit d68e0a7

Browse files
committed
Document throwing Row.get()
1 parent 172b3e5 commit d68e0a7

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

Documentation/Index.md

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -757,6 +757,18 @@ for user in try db.prepare(users) {
757757
promise to the compiler that they’ll never be `NULL`), while `Expression<T?>`
758758
values remain wrapped.
759759

760+
Column subscripts on `Row` will force try and abort execution in error cases
761+
If you want to handle this yourself, use `Row.get(_ column: Expression<V>)`:
762+
763+
```swift
764+
for user in try db.prepare(users) {
765+
do {
766+
print("name: \(try user.get(name))")
767+
} catch {
768+
// handle
769+
}
770+
}
771+
```
760772

761773
### Plucking Rows
762774

0 commit comments

Comments
 (0)