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

Add a new method to capture errors during the iteration #1027

Closed
wants to merge 1 commit into from

Conversation

gsabran
Copy link

@gsabran gsabran commented Oct 8, 2020

The iterator returned by prepare would crash during iteration when it encounters an error at

return try! failableNext()

This PR proposes a change to add a method to load all of the query's results at once, safely catching possible errors.

@nathanfallet
Copy link
Collaborator

@gsabran I merged #1030, does it fix the problem or this PR needs to be merged as well? (because it is related)

@jberkel
Copy link
Collaborator

jberkel commented Aug 25, 2021

the suggested change is problematic for large queries (memory)

@jberkel
Copy link
Collaborator

jberkel commented Sep 7, 2021

actually this is already possible with the RowIterator API:

let result = try Array(db.prepareRowIterator(users))

@gsabran
Copy link
Author

gsabran commented Oct 7, 2021

thanks

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

Successfully merging this pull request may close these issues.

3 participants