Currently it is only possible to fetch the result of a SQL query eagerly.
final List<Book> books = Query.of("SELECT * FROM book WHERE title ilike :title")
.on(value("title", "%" + title.toLowerCase() + "%"))
.as(PARSER.list(), conn);
It should additionally be possible to do the fetch lazily.
final Stream<Book> books = Query.of("SELECT * FROM book WHERE title ilike :title")
.on(value("title", "%" + title.toLowerCase() + "%"))
.as(PARSER.stream(), conn);
// The stream must be closed explicitly to close and release the underlying
// `ResultSet` object.
try (stream) {
stream.forEach(System.out::println);
}
Currently it is only possible to fetch the result of a SQL query eagerly.
It should additionally be possible to do the fetch lazily.