8 releases

0.6.0 Jan 17, 2022
0.5.0 Apr 2, 2020
0.5.0-rc.2 Mar 31, 2020

#1889 in Database interfaces

50 downloads per month

MIT license

3.5K SLoC

Stable Test codecov Rust Docs Crate version Download License: MIT

This crate provides diesel integration with roa framework.


A context extension to access r2d2 pool asynchronously.

use roa::{Context, Result};
use diesel::sqlite::SqliteConnection;
use roa_diesel::Pool;
use roa_diesel::preload::*;
use diesel::r2d2::ConnectionManager;

struct State(Pool<SqliteConnection>);

impl AsRef<Pool<SqliteConnection>> for State {
    fn as_ref(&self) -> &Pool<SqliteConnection> {

async fn get(ctx: Context<State>) -> Result {
    let conn = ctx.get_conn().await?;
    // handle conn


A context extension to execute diesel query asynchronously.

Refer to integration example for more use cases.


~313K SLoC