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

Allow to specify custom connection reset query builder #1146

Closed

Conversation

dsav
Copy link

@dsav dsav commented Apr 12, 2024

The default connection reset behaviour might be an overkill for some cases e.g. when respective server capabilities are not used or resources are cleaned up explicitly before returning the connection to the pool.

This provides an opt-in way to override this default behaviour.

Also see #780

The default connection reset behaviour might be an overkill
for some cases e.g. when respective server capabilities are not used
or resources are cleaned up explicitly before returning the connection
to the pool.

This provides an opt-in way to override this default behaviour.

Also see MagicStack#780
elprans added a commit that referenced this pull request Oct 18, 2024
A coroutine can be passed to the new `reset` argument of `create_pool`
to control what happens to the connection when it is returned back to
the pool by `release()`.  By default `Connection.reset()` is called.
Additionally, `Connection.get_reset_query` is renamed from
`Connection._get_reset_query` to enable an alternative way of
customizing the reset process via subclassing.

Closes: #780
Closes: #1146
@elprans
Copy link
Member

elprans commented Oct 18, 2024

I ended up taking a slightly different approach in #1191.

elprans added a commit that referenced this pull request Oct 18, 2024
A coroutine can be passed to the new `reset` argument of `create_pool`
to control what happens to the connection when it is returned back to
the pool by `release()`.  By default `Connection.reset()` is called.
Additionally, `Connection.get_reset_query` is renamed from
`Connection._get_reset_query` to enable an alternative way of
customizing the reset process via subclassing.

Closes: #780
Closes: #1146
@elprans elprans closed this in f6ec755 Oct 18, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants