pub fn pool(
        &self,
    ) -> &<<RequestCtx as RequestContext>::DBEndpointType as DatabaseEndpoint>::PoolType {
        &self.pool
    }
/// Returns a pool of database connections
///
/// # Examples
///
/// ```rust,no_run
/// # use std::collections::HashMap;
/// # use tokio::main;
/// # use warpgrapher::engine::context::RequestContext;
/// # #[cfg(feature = "neo4j")]
/// # use warpgrapher::engine::database::DatabaseEndpoint;
/// # #[cfg(feature = "neo4j")]
/// # use warpgrapher::engine::database::neo4j::Neo4jEndpoint;
/// # use warpgrapher::engine::resolvers::Resolvers;
/// # use warpgrapher::engine::validators::Validators;
/// # use warpgrapher::engine::context::GraphQLContext;
/// # use warpgrapher::engine::events::EventHandlerBag;
///
/// # #[derive(Clone, Debug)]
/// # struct AppCtx {}
/// #
/// # #[cfg(feature = "neo4j")]
/// # impl RequestContext for AppCtx {
/// #   type DBEndpointType = Neo4jEndpoint;
/// #   fn new() -> Self {AppCtx{}}
/// # }
/// #
/// # #[tokio::main]
/// # async fn main() -> Result<(), Box<dyn std::error::Error>> {
/// # #[cfg(feature = "neo4j")]
/// let ne = Neo4jEndpoint::from_env()?;
/// # #[cfg(feature = "neo4j")]
/// let resolvers: Resolvers<AppCtx> = Resolvers::new();
/// let validators: Validators = Validators::new();
/// # #[cfg(feature = "neo4j")]
/// let gqlctx: GraphQLContext<AppCtx> = GraphQLContext::new(
///     ne.pool().await?,
///     resolvers,
///     validators,
///     EventHandlerBag::<AppCtx>::new(),
///     Some(AppCtx::new()),
///     None,
///     HashMap::new()
/// );
///
/// # #[cfg(feature = "neo4j")]
/// let db_pool = gqlctx.pool();
/// # Ok(())
/// # }
/// ```
Returns a pool of database connections
Returns a pool of database connections
pub fn pool(
        &self,
    ) -> &<<RequestCtx as RequestContext>::DBEndpointType as DatabaseEndpoint>::PoolType {
        &self.pool
    }
pub fn pool ( & self , ) -> & < < RequestCtx as RequestContext > :: DBEndpointType as DatabaseEndpoint > :: PoolType { & self . pool }
Returns a pool of database connections
Returns a pool of database connections
&self
&self
examples
None
use std::collections::hashmap;
None
use tokio::main;
None
use warpgrapher::engine::context::requestcontext;
None
#[cfg(feature = "neo4j")]
None
use warpgrapher::engine::database::databaseendpoint;
None
#[cfg(feature = "neo4j")]
None
use warpgrapher::engine::database::neo4j::neo4jendpoint;
None
use warpgrapher::engine::resolvers::resolvers;
None
use warpgrapher::engine::validators::validators;
None
use warpgrapher::engine::context::graphqlcontext;
None
use warpgrapher::engine::events::eventhandlerbag;
None
#[derive(clone, debug)]
None
struct appctx {}
None
#[cfg(feature = "neo4j")]
None
impl requestcontext for appctx {
None
type dbendpointtype = neo4jendpoint;
None
fn new() -> self {appctx{}}
None
}
None
#[tokio::main]
None
async fn main() -> result<(), box<dyn std::error::error>> {
None
#[cfg(feature = "neo4j")]
let ne = Neo4jEndpoint::from_env()?.
let ne = Neo4jEndpoint :: from_env () ? .
#[cfg(feature = "neo4j")]
let resolvers: Resolvers = Resolvers::new();
let validators: Validators = Validators::new().
let resolvers : Resolvers = Resolvers :: new () ; let validators : Validators = Validators :: new () .
#[cfg(feature = "neo4j")]
let gqlctx: GraphQLContext = GraphQLContext::new(
ne.pool().await?,
resolvers,
validators,
EventHandlerBag::::new(),
Some(AppCtx::new()),
None,
HashMap::new()
).
let gqlctx : GraphQLContext = GraphQLContext :: new ( ne . pool () . await? resolvers validators EventHandlerBag :::: new () Some ( AppCtx :: new () ) None HashMap :: new () ) .
#[cfg(feature = "neo4j")]
let db_pool = gqlctx.pool().
let db_pool = gqlctx . pool () .
ok(())
None
}
None