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

error: the trait bound `tokio_postgres::NoTls: #53

Closed
kushwahashiv opened this issue Jan 15, 2020 · 1 comment
Closed

error: the trait bound `tokio_postgres::NoTls: #53

kushwahashiv opened this issue Jan 15, 2020 · 1 comment

Comments

@kushwahashiv
Copy link

[package]
name = "db_pool"
version = "0.1.0"
edition = "2018"

[dependencies]
bb8 = "0.3.1"
bb8-postgres = "0.3.1"
diesel = { version = "1.4.3", features = ["postgres", "extras"] }
failure = "0.1"
futures = "0.1"
futures-state-stream = "0.2"
postgres = "0.17.0"
tokio-postgres = "0.5.1"
use bb8;
use bb8_postgres;
use futures::future;
use futures::prelude::*;
use tokio_postgres;
use tokio_postgres::NoTls;


#[derive(Clone, Debug)]
pub struct Pool {
    inner: bb8::Pool<bb8_postgres::PostgresConnectionManager<NoTls>>
}

impl From<bb8::Pool<bb8_postgres::PostgresConnectionManager<NoTls>>> for Pool {
    fn from(v: bb8::Pool<bb8_postgres::PostgresConnectionManager<NoTls>>) -> Self {
        Self { inner: v }
    }
}

I am getting following error:

error: the trait bound `tokio_postgres::NoTls: bb8_postgres::tokio_postgres::tls::MakeTlsConnect<bb8_postgres::tokio_postgres::Socket>` is not satisfied
label: the trait `bb8_postgres::tokio_postgres::tls::MakeTlsConnect<bb8_postgres::tokio_postgres::Socket>` is not implemented for `tokio_postgres::NoTls`

image

@djc
Copy link
Owner

djc commented Jan 16, 2020

You have a version mismatch going on. You need to use bb8 from master to be able to use tokio-postgres 0.5 (I hope to release a new version of bb8 soon).

@djc djc closed this as completed Jan 16, 2020
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

2 participants