sfackler / rust-postgres

Native PostgreSQL driver for the Rust programming language
Apache License 2.0
3.52k stars 446 forks source link

impl ToSql for Iterators? #1111

Closed ash-hashtag closed 9 months ago

ash-hashtag commented 9 months ago

So we don't have to create a Vec everytime we map something to something, we should be able to pass just the Iterator.

I don't think its that really necessary of a feature, but would be a nice thing.

Looking at the ToSql for &[T], it just uses self.iter(), self.len(), so Iterator by itself might not be possible, but more like a struct that takes a slice and a mapping function, so len() is available as well as Iterator, but I guess that becomes ugly too quickly