stephencelis / SQLite.swift

A type-safe, Swift-language layer over SQLite3.
MIT License
9.57k stars 1.54k forks source link

Update behaviour: swift Codable with Optional fields #1175

Open Alkenso opened 1 year ago

Alkenso commented 1 year ago

In some past SQLiteEncoder skips to update the column if the Codable's optional field is nil Seems after https://github.com/stephencelis/SQLite.swift/issues/838 it starts to place null if the value is nil, which is not convenient in some cases (often you want to update only part of the fields)

Please provide either

jberkel commented 1 year ago

There wasn't really any change done as part of #838 (it looks like the issue was closed without resolving it). The last changes to the codable functionality was done in #1138

Alkenso commented 1 year ago

And what do you think to add such flexibility to SQLiteEncoder? To give and option to encode nil and null with replacement / just ignore nils