News for hackers. Stuff that matters.
Re:Diesel: A Safe, Extensible ORM and Query Builder for Rust by rabidferret on Friday February 05, 2016 @06:41PM (#11045562)
I'm not sure I entirely understand the question, but we ultimately end up hooking into libpq, and right now the queries are synchronous. As we look towards features like associations, this will actually have to be true to some extent, since if we want the return type to be `(User, Vec<Post>)`, we actually need to allocate the entire result set we're reading into memory to implement `next()`.
Re:Diesel: A Safe, Extensible ORM and Query Builder for Rust by Manishearth on Saturday February 06, 2016 @01:17PM (#11048909)
Would it be desirable or possible to instead return a lazy collection that only fetches perhaps 10 results and fetches more as you iterate?
Re:Diesel: A Safe, Extensible ORM and Query Builder for Rust by rabidferret on Saturday February 06, 2016 @02:45PM (#11049407)
It's impossible. We can't guarantee the order of the result set, so we'd have to iterate the entire collection just to implement `next`