-
Notifications
You must be signed in to change notification settings - Fork 1.4k
refactor(any): Implement fetch_optional in terms of fetch_many #3965
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
base: main
Are you sure you want to change the base?
refactor(any): Implement fetch_optional in terms of fetch_many #3965
Conversation
95f7772
to
3358247
Compare
Wouldn't |
Thanks for bringing this up.
Though not a part of this PR, I am exploring an implementation of named parameters and this being de-duplicated helps with it (as well as simplifying the existing code). |
You're absolutely right, my bad. My main fear was that this would alter existent behavior but, given that the method did not have a default impl, it won't. Also silly me because Just stumbled upon this issue as I was searching for something else and wanted to give my 2 cents. The whole reason I'm interested in this is because there seems not to be a clear separation between I was even considering going to the extent of erroring out early in Anyway, just to wrap up my brainstorming, while |
Please feel free to add more comments even if you're not sure. I have a few more prs that you may be interested in a heads up on since you maintain an implementation of another db platform: While I am not a maintainer, an extra set of eyes and comments may be helpful to the maintainer if/when he gets around to looking at these. |
…r db platforms Signed-off-by: Joshua Potts <8704475+iamjpotts@users.noreply.github.com>
…arguments by removing lifetime parameter from SqliteArguments Signed-off-by: Joshua Potts <8704475+iamjpotts@users.noreply.github.com>
Signed-off-by: Joshua Potts <8704475+iamjpotts@users.noreply.github.com>
Signed-off-by: Joshua Potts <8704475+iamjpotts@users.noreply.github.com>
…ents, and SqliteArgumentsBuffer Signed-off-by: Joshua Potts <8704475+iamjpotts@users.noreply.github.com>
Signed-off-by: Joshua Potts <8704475+iamjpotts@users.noreply.github.com>
Signed-off-by: Joshua Potts <8704475+iamjpotts@users.noreply.github.com>
Signed-off-by: Joshua Potts <8704475+iamjpotts@users.noreply.github.com>
Signed-off-by: Joshua Potts <8704475+iamjpotts@users.noreply.github.com>
3358247
to
b27505b
Compare
fetch_many
fetch_optional
implementations to loop over thefetch_many
result stream until the first row is found (previously, some implementations could return None if a row was present in the stream, but a statistics entryAnyQueryResult
was returned first).New commit with this pr is the last one,
refactor(any): Implement fetch_optional in terms of fetch_many
Builds on:
#3960
Does your PR solve an issue?
No
Is this a breaking change?
No, but it does add a default implementation for
AnyConnectionBackend::fetch_optional
which only thesqlite
implementation overrides.