4 ms·
You always have the option to wire together multiple Datalog queries using Clojure/JVM-lang-of-choice (the N+1 query problem doesn't affect Crux when embedded),
by refset 6y ago
You always have the option to wire together multiple Datalog queries using Clojure/JVM-lang-of-choice (the N+1 query problem doesn't affect Crux when embedded), but we are currently analysing the possibilities for a higher-level query API, potentially in a similar vein to Mongo's pipelines [0], where a sequence of "stages" is defined. In the ideal case there would be _closure_ in the intermediate steps of a pipeline such that the output to any given stage (including Datalog queries) is a fully-fledged graph in its own right.
As for your specific examples, Crux already implements an order-by+limit+offset combination that automatically spills to disk if needed, but for efficient pagination you would probably want to maintain additional pre-sorted value ranges. For basic aggregation we have an alpha API decorator that composes Clojure transducers to great effect [1].
[0] https://docs.mongodb.com/manual/reference/operator/aggregation-pipeline/ https://docs.mongodb.com/manual/reference/operator/aggregati...
[1] https://github.com/crux-labs/crux-decorators/blob/master/test/crux/aggregation_test.clj https://github.com/crux-labs/crux-decorators/blob/master/tes...