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 AsyncConnectionWrapper to be unwrapped #213

Open
xtexx opened this issue Feb 2, 2025 · 1 comment
Open

Allow AsyncConnectionWrapper to be unwrapped #213

xtexx opened this issue Feb 2, 2025 · 1 comment
Labels
enhancement New feature or request help wanted Extra attention is needed

Comments

@xtexx
Copy link

xtexx commented Feb 2, 2025

AsyncConnectionWrapper::from takes the ownership of AsyncConnection, but there isn't a way to unwrap and take the ownership back.

This can be useful when the connection wrapper is only used for a short time. For example, when used with diesel_migrations, if we can't unwrap the connection back, we will have to open a new connection for migrating, and the connection cannot be re-pooled after using.

Another use case is that, when running unit tests with SQLite in memory database, it is important not to re-open connection as all data will be lost.

@xtexx xtexx added the bug Something isn't working label Feb 2, 2025
@weiznich weiznich added enhancement New feature or request help wanted Extra attention is needed and removed bug Something isn't working labels Feb 4, 2025
@weiznich
Copy link
Owner

weiznich commented Feb 4, 2025

I'm happy to accept a PR for this as long as it comes with documentation + tests.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

2 participants