-
Notifications
You must be signed in to change notification settings - Fork 777
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
kotlin: add Query class to support timeout and cancellation #368
Merged
Conversation
This file contains 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
cc: @ryanhall07 @tirsen @swankjesse PTAL |
There's now a `sqlc.runtime` package containing a few abstract classes implemented by the each query method. The query methods now return these intermediate classes rather than executing the query directly. You have to now explicitly call `.execute()` on the return value. I don't really like this level of indirection, but it now makes it possible to set timeouts at the per-query level, and allows queries to be canceled. It also opens up the possibility of "interceptors" for query objects that can be used to apply additional common code.
mightyguava
force-pushed
the
kotlin-runtime
branch
from
February 28, 2020 20:04
f9ec945
to
7e54535
Compare
@kyleconroy fyi i'm setting up the artifact hosting, let me know if you want to make an account for yourself https://issues.sonatype.org/browse/OSSRH-55459 |
mightyguava
added a commit
to mightyguava/sqlc
that referenced
this pull request
Nov 9, 2020
The runtime in sqlc-dev#368 turned out to be a bad idea. It's pretty much unnecessary and adds quite a bit to the complexity of the generated code. It's _possible_ a runtime would be useful in the future. At that point we can add that back in
mightyguava
added a commit
to mightyguava/sqlc
that referenced
this pull request
Nov 9, 2020
The runtime in sqlc-dev#368 turned out to be a bad idea. It's pretty much unnecessary and adds quite a bit to the complexity of the generated code. It's _possible_ a runtime would be useful in the future. At that point we can add that back in
mightyguava
added a commit
to mightyguava/sqlc
that referenced
this pull request
Nov 9, 2020
The runtime in sqlc-dev#368 turned out to be a bad idea. It's pretty much unnecessary and adds quite a bit to the complexity of the generated code. It's _possible_ a runtime would be useful in the future. At that point we can add that back in
kyleconroy
pushed a commit
that referenced
this pull request
Nov 14, 2020
The runtime in #368 turned out to be a bad idea. It's pretty much unnecessary and adds quite a bit to the complexity of the generated code. It's _possible_ a runtime would be useful in the future. At that point we can add that back in
eliteprodev
pushed a commit
to eliteprodev/safesql_generator
that referenced
this pull request
May 17, 2023
The runtime in sqlc-dev/sqlc#368 turned out to be a bad idea. It's pretty much unnecessary and adds quite a bit to the complexity of the generated code. It's _possible_ a runtime would be useful in the future. At that point we can add that back in
eliteprodev
added a commit
to eliteprodev/safesql_generator
that referenced
this pull request
Jun 26, 2023
The runtime in sqlc-dev/sqlc#368 turned out to be a bad idea. It's pretty much unnecessary and adds quite a bit to the complexity of the generated code. It's _possible_ a runtime would be useful in the future. At that point we can add that back in
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
There's now a
sqlc.runtime
package containing a few abstract classes implemented by the each query method. The query methods now return these intermediate classes rather than executing the query directly. You have to now explicitly call.execute()
on the return value. I don't really like this level of indirection, but it now makes it possible to set timeouts at the per-query level, and allows queries to be canceled. It also opens up the possibility of "interceptors" for query objects that can be used to apply additional common code.The runtime library is at https://github.com/kyleconroy/sqlc-kotlin-runtime. I haven't published it to maven yet. It's kinda complicated and will take some time. So the runtime is checked in to this repo in the meantime to let tests pass.