INNER CODE UNIT · Rust

get_conn_from_ctx

rkudryashov/graphql-rust-demo · satellites-service/src/lib.rs:47

pub fn get_conn_from_ctx(ctx: &Context<'_>) -> PooledConnection<ConnectionManager<PgConnection>> {
    ctx.data::<PgPool>()
        .expect("Can't get pool")
        .get()
        .expect("Can't get DB connection")
}

View source record →

📰 Research Paper
Loading…
⏳ Fetching content…