Skip to content

Allow accessing state's internal pool #41

Closed
@arcstur

Description

@arcstur

Sometimes I need the pool, to construct other stuff in the application. It would be useful to access the state's internal pool, so that I don't need to have two of the same pool in my app's state. What do you think?

What I mean is that I don't want to have

#[derive(Clone, FromRef)]
pub struct AppState {
    pub pool: PgPool,
    pub tx_state: axum_sqlx_tx::State<sqlx::Postgres>,
}

And have only the tx_state, since it already holds a pool.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions