Closed CodesInChaos closed 1 month ago
This looks good.
For reference, postgres crate has similar trait, named GenericClient
. I think that QueryExecutor
is a better name. Other db clients that I've checked (mysql, tiberious, sqlite) don't have such traits.
I think we'd need to bump MSRV from 1.72 to 1.75 for "async fn
returning impl Trait
".
This is a reasonable, since 1.75 is 8 versions before current stable (1.80.1).
The trait enables writing functions that don't care if they're executed in a transaction or directly on a client.
Handling of
Send
needs to be discussed. Currently I'm not constraining anything toSend
, but perhaps the returned futures need to be, but that might require adding constraints to some of the generic arguments (e.g.QueryResult
) as well.Closes #339