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

GRDB 7: enhance ergonomics of record methods that insert/save/upsert and fetch #1599

Merged
merged 1 commit into from
Aug 24, 2024

Conversation

groue
Copy link
Owner

@groue groue commented Aug 24, 2024

The insertAndFetch, saveAndFetch, and updateAndFetch methods no longer return optionals.

When inserts and updates are performed with the IGNORE conflict policy, those methods can throw RecordError.recordNotFound (they used to return nil in case of conflict).

… return optionals.

Those optionals were just an annoyance. Now, nil results are replaced with `RecordError.recordNotFound`. Such an error is only expected with the IGNORE conflict policy.
@groue groue force-pushed the dev/GRDB7-non-optional-fetch branch from 39ed103 to cd4e853 Compare August 24, 2024 15:03
@groue groue merged commit 867f824 into GRDB7 Aug 24, 2024
8 checks passed
@groue groue deleted the dev/GRDB7-non-optional-fetch branch August 24, 2024 15:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant