We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
Often you are fine with zero or one result but more than one would indicate a bug. Right now you can do:
try: rec = db.one(QUERY) except TooFew: rec = None if rec is None: pass else: pass
But it might be nicer to be able to do:
rec = db.one_or_zero(QUERY) if rec is None: pass else: pass
The text was updated successfully, but these errors were encountered:
This would also be good because the try/except form doesn't account for cases where rowcount is -1.
Sorry, something went wrong.
Add a one_or_zero method; #19
17b1a52
The one method is too complex for this common case, it turns out. :-/
Write tests for one_or_zero; #19
4913060
No branches or pull requests
Often you are fine with zero or one result but more than one would indicate a bug. Right now you can do:
But it might be nicer to be able to do:
The text was updated successfully, but these errors were encountered: