Closed dancingbug closed 4 years ago
I've made some changes here, if you can take a look to see if it fixes your problems or have a suggestion on a better way to implement.
Your changes work for me.
I went a bit further as you saw (#54), leaving no params on Queryable
, which feels quite a bit nicer to use.
However, this change is introducing the only Box<...>
in the main crate, which seems undesirable (does this affect embedded? Edit: Silly me, I had mistakenly believed 'Firebird embedded' meant embedded in the hardware sense up until today )
I think there should be a better way. I might look into it more. Is there a detailed roadmap or a best place to read/ask about general design considerations?
I don't think there is need to worry about the Box
, but this can be discussed in the PR (#54).
About the detailed roadmap, we don't have nothing like this that I'm aware.
The lifetime in
Queryable<'a, R>
(andTransaction<'a,C>
,StmtIter<'a, R,C>
etc) will tend to infect whatever uses it. Unfortunately, due to some warts of the rust language, this leads to unexpected compilation errors in some cases. For example:pardon if i'm misunderstanding something, but I also also don't see why R of
Queryable<'a, R>
should be bounded by'a
at the trait level like it is in its where clause either:where R : FromRow + 'a
It seems like the lifetime of R should be unrelated to the connection/transaction/iterator at the trait level: Once we have an R on hand, we should be able to do whatever we want with it, or the Connection, in either order, if our impl allows it.