4 ms·
Not the parent, so I can't speak for them, but my experience is that it's pretty likely that you'll eventually run into situations where you really want to stor
by tene 7y ago
Not the parent, so I can't speak for them, but my experience is that it's pretty likely that you'll eventually run into situations where you really want to store something different in the DB than what you send out from your API.
For example, you may want to keep some fields internal and not expose them to users, or you may want to normalize your DB schema so some fields are stored in a linked table, or maybe you had something as timestamp+duration, and need to keep the same external API for compatibility, but also want to refactor it internally into two timestamps.
- status_quo69 7y agoYep! Serde allows us to cheat a bit since you can call for it to skip certain fields (such as password hashes), but my preference is for the field to not exist at all in your serialization structs. Less of a chance to forget that #[serde(skip)] flag