Fork me on GitHub
#datahike
<
2022-02-21
>
awb9918:02:18

Is it possible to pull only one entity. I tried to do it, but it only works for multiple entities. This works but it returns a vector of enttities:

(def woo-order-id
  '[:find [(pull ?id [*]) ...]
    :in $ woo-order-id
    :where
    [?id :woo-order/id woo-order-id]])

Björn Ebbinghaus18:02:50

1. This is something for pull. (d/pull db ['*] [:woo-order/id woo-order-id]) 2. You are using the collection find spec :find [?e ...] , but you want to use the scalar pattern :find ?e . https://docs.datomic.com/on-prem/query/query.html#find-specifications

awb9919:02:27

Thanks @U4VT24ZM3 I was looking at the pull api only. I didnt think so far to go to the find clause 🙂 Thanks!!!

Casey19:02:52

I successfully got datahike-jdbc working with the latest datahike + mysql 🎉 I noticed that there is only ever 1 one created in the konserve table (after ~50 entities). What implications does this have when querying data, when the total stored size is greater than the amount of RAM? Maybe I need to add more data to see more rows.

Casey19:02:59

Ah, ok after inserting more data, eventually more rows appeared in the table. I suppose what's stored in the db is the hitchhiker tree, and at some point it partitions itself.

✔️ 1
metasoarous01:02:58

Yup; That's the idea. It's just using the database as a kv store (which is what konserve abstracts over), and the hitchiker tree index is written out over that kv store.