You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This has been asked before. I can't seam to find the issue right now so I'm writing this down as a reminder.
Right now when using deadpool-postgres and using it together with tokio-postgres + with-uuid-0_8 there is no other way than adding both deadpool-postgres and tokio-postgres (+ with-uuid-0_8) to the dependencies while making sure that the versions match.
It was many times before if deadpool-postgres could just reexport all the feature flags of tokio-postgres. I have no absolute oppionion here and in the end decided against it as it's yet one more thing to maintain.
Just looking at tokio-postgres it is almost a no-brainer to re-export the features. Though when you look at deadpool-sqlite it would require 35 feature flags if I'm counting correctly.
While this is not possible, I wonder if deadpool-* should work around this and re-export the features so the users of the deadpool-* crates don't have to import the backend crates themselves in order to activate features from them.
Another way to solve this would be to make the backend version explicit. e.g. deadpool-postgres in version 0.10 does have a feature called tokio-postgres-0_7 which enables the deadpool_postgres::tokio_postgres_0_7 module:
deadpool-postgres = { version = "0.10", features = ["tokio-postgres-0_7"] }
tokio-postgres = { version = "0.7", features = ["with-uuid-0_8"] }
This would make the versions 100% obvious to reason about and as a nice side-effect decouple the versions of deadpool-postgres from tokio-postgres. Right now whenever a breaking version of tokio-postgres is released a breaking version of deadpool-postgres must be released as well.
Big downside here would be that users of deadpool-postgres now have to use imports like use deadpool_postgres::tokio_postgres_0_7::Pool as the root of deadpool_postgres now contains no public exports whatsoever.
While it's easy to make this pretty in projects by creating an alias for deadpool_postgres::tokio_postgres_0_7 I'm undecided if that's actually the right path to walk on.
It feels like it adds yet another layer of confusion to an already confusing topic. 🙈
The text was updated successfully, but these errors were encountered:
This has been asked before. I can't seam to find the issue right now so I'm writing this down as a reminder.
Right now when using
deadpool-postgres
and using it together withtokio-postgres
+with-uuid-0_8
there is no other way than adding bothdeadpool-postgres
andtokio-postgres
(+with-uuid-0_8
) to thedependencies
while making sure that the versions match.It was many times before if
deadpool-postgres
could just reexport all the feature flags oftokio-postgres
. I have no absolute oppionion here and in the end decided against it as it's yet one more thing to maintain.Just looking at
tokio-postgres
it is almost a no-brainer to re-export the features. Though when you look atdeadpool-sqlite
it would require 35 feature flags if I'm counting correctly.https://github.com/rusqlite/rusqlite/blob/master/Cargo.toml - There are 30 feature flags and 7 optional dependencies. I believe two of the optional dependencies are not feature related (
lazy_static
andbyteorder
).It would be so much easier if Cargo just had a way of enabling features of dependencies of dependencies like that:
A somewhat related
cargo
issue is this: rust-lang/cargo#9094While this is not possible, I wonder if
deadpool-*
should work around this and re-export the features so the users of thedeadpool-*
crates don't have to import the backend crates themselves in order to activate features from them.Another way to solve this would be to make the backend version explicit. e.g.
deadpool-postgres
in version 0.10 does have a feature calledtokio-postgres-0_7
which enables thedeadpool_postgres::tokio_postgres_0_7
module:This would make the versions 100% obvious to reason about and as a nice side-effect decouple the versions of
deadpool-postgres
fromtokio-postgres
. Right now whenever a breaking version oftokio-postgres
is released a breaking version ofdeadpool-postgres
must be released as well.Big downside here would be that users of
deadpool-postgres
now have to use imports likeuse deadpool_postgres::tokio_postgres_0_7::Pool
as the root ofdeadpool_postgres
now contains no public exports whatsoever.While it's easy to make this pretty in projects by creating an alias for
deadpool_postgres::tokio_postgres_0_7
I'm undecided if that's actually the right path to walk on.It feels like it adds yet another layer of confusion to an already confusing topic. 🙈
The text was updated successfully, but these errors were encountered: