Fork me on GitHub
#datalevin
<
2022-10-02
>
Thanh Nguyen05:10:08

Hi. How do I limit my query with datalevin? I searched for a while, and found this:

(d/q {:query '[:find ?c ?n :where [?c :my-thing/its-attribute ?n]] 
       :offset 1
       :limit 10
       :args [(d/db conn)]})
But it seems like something Datomic specific. I tried this:
(->> (d/q '[:find ?eid
            :where [?eid _ _]]
          db)
     (take 2)
     (seq)
     (flatten)
     (d/pull-many db '[*]))
And it kind of works, but feel wrong to me somehow. (d/q ...) is going to pull all the ids over, and it might cause a memory problem. Does anyone have any suggestion for me? Thanks for the great work, by the way!

Huahai20:10:31

We will implement these after https://github.com/juji-io/datalevin/issues/108 is finished.

🙌 2