Skip to content

Update behaviour: swift Codable with Optional fields #1175

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
Alkenso opened this issue Nov 17, 2022 · 2 comments
Open

Update behaviour: swift Codable with Optional fields #1175

Alkenso opened this issue Nov 17, 2022 · 2 comments

Comments

@Alkenso
Copy link

Alkenso commented Nov 17, 2022

In some past SQLiteEncoder skips to update the column if the Codable's optional field is nil
Seems after #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

  • example/docs how to update only non-nil fields
  • additional Encoder setting that would configure this behaviour
@jberkel
Copy link
Collaborator

jberkel commented Nov 18, 2022

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
Copy link
Author

Alkenso commented Nov 19, 2022

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants