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
Enhancements to ResultIterable #2056
Enhancements to ResultIterable #2056
Conversation
Hi @sman-81 , could you share a bit about what use case you expect for these new features? In particular, we avoid doing |
c231d6e
to
2aa2768
Compare
thanks for your feedback! We avoid switching to
What do you mean? Yet, having both in JDBI serves a very good purpose, as it allows you to keep a db simple and shift more complex processing to Java. |
Hope this finds you well :) Cheers, Markus |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ok. I am still slightly concerned that newbie users would mistake that filter
somehow operates efficiently, when it actually precludes letting the database do the heavy lifting.
Perhaps we could add a note to the Javadoc to make it clear that results must be loaded into Java and then thrown away, which means e.g. that indexes cannot be used.
Otherwise people might incorrectly assume that we have LINQ-like features which actually can magically do this.
I left some comments on the implementation. Let me know what you think.
And sorry for the delay @sman-81 , I have been on vacation 🌴 |
Add method ResultIterable#filter to apply a filter (predicate) to a result iterable without use of streams. Similarities with ResultIterable#map extracted into class ResultIteratorDelegate Add enhanced ResultIterable#forEachWithCount, an enhanced forEach method that returns the iteration/record count Add unit tests Incorporate feedback from Steven
17bbc56
to
1e7275e
Compare
Your feedback incorporated and pr updated. |
Kudos, SonarCloud Quality Gate passed! 0 Bugs No Coverage information |
ResultIterable#filter
to apply a filter (predicate) to a result iterable without use of streams.Similarities with
ResultIterable#map
extracted into classResultIteratorDelegate
ResultIterable#forEachWithCount
, an enhanced forEach method that returns the iteration/record count