This repository was archived by the owner on Apr 26, 2024. It is now read-only.
Convert simple_select_one_txn and simple_select_one to return tuples.#16612
Merged
Conversation
c4b714e to
2ffd6c0
Compare
DMRobertson
reviewed
Nov 9, 2023
| "response_json", | ||
| "has_been_referenced", | ||
| ), | ||
| retcols=("response_code", "response_json"), |
DMRobertson
reviewed
Nov 9, 2023
| Optional[Tuple[bool, str, bool]], | ||
| await self.db_pool.simple_select_one( |
Contributor
There was a problem hiding this comment.
Is this going to give us integers on sqlite rather than bools?
Contributor
There was a problem hiding this comment.
Also: the boolean fieldsall three fields seem to be nullable in the DB. Sorry if there is already an issue for this.
Member
Author
There was a problem hiding this comment.
Is this going to give us integers on sqlite rather than bools?
Luckily in this case the we can just do bool(...) to handle both ints and nulls. Turns out we don't ever use the creator, so I dropped it from the response.
DMRobertson
approved these changes
Nov 9, 2023
DMRobertson
approved these changes
Nov 9, 2023
4686cd0 to
9fe2ec5
Compare
Member
Author
|
Rebased after merge of #16611. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This is the last simple_* API that automatically creates dictionaries of the provided columns.
The vast majority of the time we return only a couple of columns and immediately unpack the dictionary. This is wasteful and a continuation of #16431.
Builds on #16611.