5 ms·
I made a thing[0] just like that to do pipelined async db queries: CompletableFuture<Member> asyncProjectMembers = Async.pipeline(Accounts.where("id >= ?
by karmakaze 7y ago
I made a thing[0] just like that to do pipelined async db queries:
CompletableFuture<Member> asyncProjectMembers =
Async.pipeline(Accounts.where("id >= ?", 1000);,
(accounts) -> accounts.loadProjects("updated_at >= ?", Instant.now().minusDays(30)),
(projects) -> projects.loadMembers());
If you assign the intermediates to variables, each instance will have associated with it the related collection that's queried while avoiding N+1's.
[0] https://github.com/karmakaze/safeql https://github.com/karmakaze/safeql