bikeshedder / deadpool

Dead simple pool implementation for rust with async-await
Apache License 2.0
1.08k stars 137 forks source link

Support build_transaction() on GenericClient? #331

Closed mpalmer closed 5 months ago

mpalmer commented 5 months ago

Howdy,

A couple of related questions:

  1. Is the lack of build_transaction() on GenericClient deliberate, or just an oversight?
  2. If the answer to the previous question is "oversight", would a PR implementing the above be considered for merge?

Thanks!

bikeshedder commented 5 months ago

It's an oversight or I simply never had the need for it and/or nobody ever asked for it. Honestly I don't remember anymore. It is indeed missing. I would gladly accept a PR adding this feature to deadpool-postgres. :+1:

mpalmer commented 5 months ago

OK, after some fiddling around, I think I'm going to give this up, for a few reasons:

  1. deadpool_postgres::GenericClient is described as a one-to-one mapping of tokio_postgres::GenericClient, and the latter trait does not define build_transaction (I could have sworn it did, since I thought I'd used it before, but apparently I misremembered and previously did something else); and
  2. OMFG the trait bounds get absolutely bonkers, reaching out their long, thin tendrils into So. Many. Places.
  3. I managed to work around the problem I was having by implementing my own transaction builder-like method on the more-specific impls of my struct generic over GenericClient, so I don't actually need to delve into the madness.