How does grdb decode numbers to enums? #1447
Replies: 1 comment 1 reply
-
Hello @mikechambers, Well, it depends. When decoding a It is also possible to add an explicit conformance to By default, // Makes sure Standing values loaded from the
// database are decoded with init(rawValue:).
extension Standing: DatabaseValueConvertible { } |
Beta Was this translation helpful? Give feedback.
-
When GRDB is trying to decode an Int into an enum, does it just call init(rawValue)?
i.e. if I have this:
and standing is stored as an Int32 in the DB, will it call init(rawValue) to convert to the enum?
Beta Was this translation helpful? Give feedback.
All reactions