You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When you extract a record instead of a value from a row, GRDB looks up the tree of **association keys**. If the key is not found, or only associated with columns that all contain NULL values, an optional record is decoded asnil:
2204
+
If the key is not found, or only associated with columns that are all NULL, an optional record is decoded asnil:
2205
2205
2206
2206
```swift
2207
-
let author: Author = row["author"]
2208
-
let country: Country?= row["country"]
2207
+
let country =try row.decodeIfPresent(Country.self, forKey: "country")
2209
2208
```
2210
2209
2211
2210
You can also perform custom navigation in the tree by using *row scopes*. See [Row Adapters] for more information.
0 commit comments