Fork me on GitHub
#asami
<
2022-03-09
>
simongray09:03:33

I wonder if there a way to do limits and offsets in Asami queries? I think there is some Datomic syntax using an outer map of {:query query :args args} but it doesn’t seem that Asami supports this.

simongray09:03:15

for now I’m just doing drop and take on a memoized function result to achieve something similar

quoll11:03:11

There isn't, but to be honest, that's how I’d implement it. It's more of an issue if it's a query syntax over a network connection (which will happen when I do SPARQL), but since it's embedded only, then it doesn't apply

simongray12:03:33

Ok! No problem. I implemented sorting too. Thankfully, it wasn’t too hard in my case.

simongray12:03:59

Just a shame to implement something if it’s already been implemented elsewhere.

quoll16:03:19

Actually, I wouldn't memoize… (when implementing internally) It would use core.cache on the query to get the plan, but result would not be stored, because it's lazy. That means that the drop portion or a drop/take could involve re-execution, but this allows for large results that can't fit in memory

👀 1