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

Consider with-transaction+options and on-connection+options #256

Closed
seancorfield opened this issue Aug 9, 2023 · 2 comments
Closed

Consider with-transaction+options and on-connection+options #256

seancorfield opened this issue Aug 9, 2023 · 2 comments
Assignees
Labels
documentation The documentation is wrong or needs improving enhancement New feature or request

Comments

@seancorfield
Copy link
Owner

seancorfield commented Aug 9, 2023

Is your feature request related to a problem? Please describe.
For people using with-options, it's inconvenient to have to manually rewrap a java.sql.Connection (produced by with-transaction and on-connection) with their options again. Provide a way to have next.jdbc auto-wrap the Connection object.

Describe the solution you'd like
Variants of with-transaction and on-connection that auto-wrap the bound symbol with any options from the original "transactable" or "connectable".

Describe alternatives you've considered
Modifying with-transaction and on-connection to do this automatically -- potentially breaking change since any existing code that assumes java.sql.Connection and performs interop on it would break.

@seancorfield seancorfield added the enhancement New feature or request label Aug 9, 2023
@seancorfield seancorfield self-assigned this Aug 9, 2023
@seancorfield
Copy link
Owner Author

Note to self: there is no with-connection because the assumption is you would use with-open and get-connection instead -- and only one of the four arities of get-connection could be used here by default.

@seancorfield
Copy link
Owner Author

Added on-connection+options.

@seancorfield seancorfield added the documentation The documentation is wrong or needs improving label Aug 12, 2023
@seancorfield seancorfield changed the title Consider with-transaction+options and with-connection+options Consider with-transaction+options and on-connection+options Sep 24, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation The documentation is wrong or needs improving enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant