-
-
Notifications
You must be signed in to change notification settings - Fork 446
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Take IntoIterator rather than &[&ToSql]
.
#265
Comments
Can you give a bit more information, I would like to try and implement this? |
sfackler
added a commit
that referenced
this issue
Jul 10, 2019
The existing methods which take slices of parameters work well when directly passing a temporary slice (e.g. `c.query(s, &[&15, &"hi"])`, but becomes limiting in other contexts like when programmatically building up a query. We now offer methods which take iterators, which are significantly more flexible for these kinds of use cases. Because of the weird object safety of `ToSql`, we can't be generic over `Iterator<Item = impl ToSql>`, but instead have to specifically work with `Iterator<Item = &dyn ToSql>`. This may require a `.map()` or two but should still work fine. Closes #265
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
It might be pretty tricky to figure out the exact bounds that will work, but we don't need a slice of
&ToSql
specifically.The text was updated successfully, but these errors were encountered: