Fork me on GitHub
#datascript
<
2017-04-15
>
bbss02:04:20

@lvh datomic free?

lvh02:04:54

hm, that’s not a bad suggestion; but I thought datomic didn’t do nested, intension-like structures

lvh02:04:04

so, yeah but I’d have to turn it into real datoms, right?

bbss02:04:09

Oh, I haven't really looked into intension. But yeah I think you'd need to convert it to datoms. Interesting that intension doesn't need that 🙂

bbss02:04:41

Is the tip at https://github.com/tonsky/datascript/wiki/Tips-&amp;-tricks#querying-on-a-missing-attribute still valid? I am getting: get-else: nil default value is not supported.

bbss02:04:55

value different from nil works though:

(d/q '[:find (pull ?t-id [*])
                         :where
                         [?t-id :task/name _]
                         [(get-else $ ?t-id :task/children "nought") ?child]
                         [(= ?child "nought")]]
                       @db)

misha03:04:10

@bbss what are you trying to accomplish?

misha03:04:33

(let [conn (ds/create-conn)]
  (ds/transact! conn [{:foo 1 :bar 2} {:foo 11}])
  (ds/q '[:find [(pull ?e [*]) ...]
          :in $
          :where
          [?e]
          [(missing? $ ?e :bar)]]
    @conn))
=> [{:db/id 2, :foo 11}]

bbss08:04:10

@misha Right, I was missing the missing function 🙂

bbss08:04:22

I guess that should be updated in the tips & tricks I linked