weiznich / diesel_async

Diesel async connection implementation
Apache License 2.0
659 stars 82 forks source link

Derive Debug for SyncConnectionWrapper #199

Closed tibbe closed 1 week ago

tibbe commented 1 week ago

This is needed when trying to use tower-sessions with this crate. tower-sessions requires Debug for the provided backend store. In my particular case the store looks like:

type SqlitePool = deadpool::Pool<SyncConnectionWrapper<sqlite::SqliteConnection>>;

#[derive(Clone, Debug)]
pub struct AsyncSqliteStore {
    pool: SqlitePool,
}

The error without this Debug impl is:

`diesel_async::sync_connection_wrapper::SyncConnectionWrapper<diesel::SqliteConnection>` doesn't implement `std::fmt::Debug`
the trait `std::fmt::Debug` is not implemented for `diesel_async::sync_connection_wrapper::SyncConnectionWrapper<diesel::SqliteConnection>`, which is required by `deadpool::managed::Pool<diesel_async::pooled_connection::AsyncDieselConnectionManager<diesel_async::sync_connection_wrapper::SyncConnectionWrapper<diesel::SqliteConnection>>>: std::fmt::Debug`
tibbe commented 1 week ago

The particular trait I need to implement that required Debug is https://docs.rs/tower-sessions/0.13.0/tower_sessions/trait.SessionStore.html.

tibbe commented 1 week ago

The MacOS build failures seem unrelated.