ankushg
03/03/2022, 1:16 AMkotlinx.serialization
to serialize/deserialize an actual class from a String column
I’m trying to determine how to handle changes to the JSON document’s schema (which is just a change in the @Serializable data class
).
In most of those cases, I’d be fine with dropping the old data and repopulating it next time I fetch from the server.
I could write a .sqm
file that drops all rows in the tables containing impacted documents, but I’m foreseeing situations where someone updates the data class without writing a migration. Since the sqlite schema would still just have the row as a String, I’m assuming that SQLDelight’s migration verifications would still pass.
Is there a way to ignore/drop data that doesn’t deserialize properly in my ColumnAdapter
? Should I just be making all of my types nullable?Paul Woitaschek
03/03/2022, 7:04 AM