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

API overhaul #736

Open
jberkel opened this issue Sep 28, 2017 · 3 comments
Open

API overhaul #736

jberkel opened this issue Sep 28, 2017 · 3 comments
Milestone

Comments

@jberkel
Copy link
Collaborator

jberkel commented Sep 28, 2017

Especially w.r.t error handling

@jberkel jberkel added this to the 0.12.0 milestone Sep 28, 2017
@jberkel jberkel mentioned this issue Sep 28, 2017
@MrMage
Copy link
Contributor

MrMage commented Oct 2, 2017

Not sure if this is related, but I recently changed Statement.next() to avoid using try!, as this occasionally caused crashes in my app. (Only when the SQLite DB was malformed, but still.) Instead, Statement.next now returns either a "success" result or the error thrown by .step().

In case you are interested, the commit at hand is Timing-GmbH@c2f9cd0. I'm not suggesting cherry-picking this 1-by-1, but if you are about to overhaul the API anyway, consider changing Statement.next() to return a "success-or-error" type instead of using try!. Adding throws to the method signature would be the nicer approach, but unfortunately that would break Statements conformance to IteratorProtocol.

@jberkel
Copy link
Collaborator Author

jberkel commented Oct 2, 2017

@MrMage thanks! this has already been discussed in #569. A Either type solution was proposed there as well. Right now there's a "stop-gap" solution in 0.11.4 with #726 but I'm not completely happy with that. The FailableIterator type introduced there doesn't really work well with the remaining Swift types. For 0.12 we could rethink some of these approaches.

@MrMage
Copy link
Contributor

MrMage commented Oct 2, 2017 via email

@jberkel jberkel modified the milestones: 0.12.0, 0.13.1 Aug 23, 2021
@jberkel jberkel modified the milestones: 0.13.1, 0.13.2 Nov 17, 2021
@jberkel jberkel modified the milestones: 0.14.0, 0.14.1 Jul 17, 2022
@jberkel jberkel modified the milestones: 0.14.1, 0.15.0 May 22, 2023
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

2 participants