Skip to content

Allow AsyncConnectionWrapper to be unwrapped #213

Open
@xtexx

Description

@xtexx

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or requesthelp wantedExtra attention is needed

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions