Comments (6)
I was able to make it work by setting the type to: deadpool::managed::Pool<AsyncDieselConnectionManager<AsyncPgConnection>>
Dont know if that is the proper setup :)
from diesel_async.
@weiznich Yes, sorry, i was playing with different pool providers, so there might be some misunderstanding. But I still believe something is not right here. Cleaned code to show the problem.
pub struct MyService {
// This one is throwing the error
// pool: diesel_async::pooled_connection::deadpool::Pool<
// diesel_async::pooled_connection::AsyncDieselConnectionManager<
// diesel_async::AsyncPgConnection,
// >,
// >,
// this one require me to install deadpool cargo seperate, but everything here works
pool: deadpool::managed::Pool<
diesel_async::pooled_connection::AsyncDieselConnectionManager<
diesel_async::AsyncPgConnection,
>,
>,
}
And ofc fn to create a poll is taken from the docs, using diesel_async types:
pub fn establish_connection(database_url: &str) -> Result<Pool<AsyncPgConnection>> {
let config = AsyncDieselConnectionManager::<AsyncPgConnection>::new(database_url);
let pool = Pool::builder(config)
.build()
.context("Error creating pool")?;
return Ok(pool);
}
from diesel_async.
The solution here is to diesel_async::pooled_connection::bb8::Pool<AsyncPgConnection>
from diesel_async.
Closed because it seems like you've just mixed up different types with the name Pool
.
For future similar questions: Please use the support forum as the issue tracker is for tracking bugs.
from diesel_async.
I have the same issue
[dependencies]
diesel = { version = "2.1.0", features = [
"postgres",
"r2d2",
"uuid",
"chrono",
] }
diesel-async = { version = "0.3.1", features = ["postgres", "bb8"] }
use diesel_async::pooled_connection::bb8::Pool;
use diesel_async::pooled_connection::AsyncDieselConnectionManager;
use diesel_async::AsyncPgConnection;
pub type AsyncPool =
diesel_async::pooled_connection::bb8::Pool<AsyncDieselConnectionManager<AsyncPgConnection>>;
#[derive(Clone)]
pub struct AccountRepository {
db: AsyncPool,
}
error[E0277]: the trait bound `AsyncDieselConnectionManager<AsyncPgConnection>: PoolableConnection` is not satisfied
--> crates/shared/src/lib.rs:10:9
|
10 | db: AsyncPool,
| ^^^^^^^^^ the trait `PoolableConnection` is not implemented for `AsyncDieselConnectionManager<AsyncPgConnection>`
from diesel_async.
Please do not use the issue tracker to discuss support issues. It's a place for technical discussions about features and bugs. It's not meant to be a support forum.
from diesel_async.
Related Issues (20)
- Failed to find a type oid for ENUM_TYPE HOT 30
- Compiler requires `'static` when using transactions on generic AsyncConnection HOT 1
- The trait MultiConnection is not implemented
- conflicting implementations of trait `diesel_async::RunQueryDsl<_>` for type `paginate_async::PaginatedQuery<_, _>` HOT 4
- conflicting implementations of trait diesel_async::RunQueryDsl<_> for type paginate_async::PaginatedQuery<_, _> HOT 1
- use diesel_async::RunQueryDsl::execute conflicts with meilisearch_sdk execute HOT 5
- AsyncConnectionWrapper does not implement `build_transaction` HOT 2
- r2d2 not supported with AsyncPgConnection HOT 2
- Unable to connect to PostgreSQL in a separate Kubernetes pod using Diesel in Rust
- Failed to save array of enums HOT 2
- Is there some way to get the last insert id after an insert operation?
- Problem trait LoadQuery is not satisfied sub query when implement Pagination
- New release? HOT 1
- Incoherence between Diesel and Diesel_async on MySQL/MariaDB connection (UPDATE return value) HOT 1
- The conneciton pool returns corrupt connections HOT 3
- RunQueryDsl overrides calls to vec.first() to RunQueryDsl::first() HOT 4
- 0.4.x doesn't work with custom types HOT 1
- diesel_async does not support sql_query (async) HOT 3
- Unable to execute `COPY FROM`, likely due to missing `ExecuteCopyFromDsl` trait HOT 1
- Fail to get the connection with the features ["postgres", "bb8"] HOT 4
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from diesel_async.