pub async fn rpc_api(datamodel: &str) -> CoreResult<IoHandler> {
    let mut io_handler = IoHandler::default();
    let executor = Arc::new(crate::migration_api(datamodel).await?);

    for cmd in AVAILABLE_COMMANDS {
        let executor = executor.clone();
        io_handler.add_method(cmd, move |params: Params| {
            Box::pin(run_command(executor.clone(), cmd, params))
        });
    }

    Ok(io_handler)
}
/// Initialize a JSON-RPC ready migration engine API. This entails starting
/// a database connection.
Initialize a JSON-RPC ready migration engine API. This entails starting
a database connection.
Initialize a JSON - RPC ready migration engine API . This entails starting a database connection .
pub async fn rpc_api(datamodel: &str) -> CoreResult<IoHandler> {
    let mut io_handler = IoHandler::default();
    let executor = Arc::new(crate::migration_api(datamodel).await?);
    for cmd in AVAILABLE_COMMANDS {
        let executor = executor.clone();
        io_handler.add_method(cmd, move |params: Params| {
            Box::pin(run_command(executor.clone(), cmd, params))
        });
    }
    Ok(io_handler)
}
pub async fn rpc_api ( datamodel : & str ) -> CoreResult < IoHandler > { let mut io_handler = IoHandler :: default ( ) ; let executor = Arc :: new ( crate :: migration_api ( datamodel ) . await ? ) ; for cmd in AVAILABLE_COMMANDS { let executor = executor . clone ( ) ; io_handler . add_method ( cmd , move | params : Params | { Box :: pin ( run_command ( executor . clone ( ) , cmd , params ) ) } ) ; } Ok ( io_handler ) }
Initialize a JSON-RPC ready migration engine API.
Initialize a JSON - RPC ready migration engine API .
datamodel
&str