Skip to content
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

Fix a bug in Decodable support #1533

Merged
merged 3 commits into from Apr 21, 2024
Merged

Fix a bug in Decodable support #1533

merged 3 commits into from Apr 21, 2024

Conversation

groue
Copy link
Owner

@groue groue commented Apr 20, 2024

This pull request fixes a bug in the GRDB support for Decodable types.

The decodeNil(forKey:) method of the keyed container that feeds from a database row could wrongly return false, and prevent an app from successfully decoding a nil optional value from a NULL column. This is fixed.

This PR also introduces a partial support for nestedContainer(keyedBy:forKey:). This method used to crash with a "not implemented" fatal error. Now it can decode nested scopes added by a ScopeAdapter or requests that include a to-one association such as BelongsTo or HasOne. It is still impossible to trigger JSON decoding of a column by using this method.

Fixes #1531.

@groue groue merged commit 1525075 into development Apr 21, 2024
21 checks passed
@groue groue deleted the dev/fix-1531 branch April 21, 2024 10:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant