Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature Request (or Question?): Support deadpool / tokio postgres #105

Closed
eiswind opened this issue Jun 2, 2020 · 5 comments
Closed

Feature Request (or Question?): Support deadpool / tokio postgres #105

eiswind opened this issue Jun 2, 2020 · 5 comments

Comments

@eiswind
Copy link

eiswind commented Jun 2, 2020

I would appreciate some help with my poor understanding of the type system...

let mut client = db_pool.get().await?.deref_mut().deref_mut();
    let report = embedded::migrations::runner()
        .run_async(&mut client)
        .await?;

using deadpool with tokio-postgres and I get the following compile error (that I do not understand, really :)

 the trait `refinery::AsyncMigrate` is not implemented for `&mut tokio_postgres::client::Client`
@jxs
Copy link
Member

jxs commented Jun 3, 2020

hi, it's run_async(client):

    let mut obj = pool.get().await?;
    let client = obj.deref_mut().deref_mut();
    let _report = embedded::migrations::runner()
        .run_async(client)
        .await?

@eiswind
Copy link
Author

eiswind commented Jun 3, 2020

Thx a lot, that helped!

@mpiorowski
Copy link
Contributor

@jxs You should add this to the doc really :) Now most of the pg connection are done via pooling.

@jxs
Copy link
Member

jxs commented Jun 23, 2023

hi @mpiorowski makes sense yeah thanks,wanna go ahead and submit a PR with it?

@mpiorowski
Copy link
Contributor

hi @mpiorowski makes sense yeah thanks,wanna go ahead and submit a PR with it?

@jxs done :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants