This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2020-08-05
Channels
- # all-the-channels (1)
- # announcements (3)
- # asami (13)
- # beginners (227)
- # calva (2)
- # chlorine-clover (8)
- # cider (7)
- # clj-kondo (4)
- # cljs-dev (21)
- # cljsrn (8)
- # clojure (64)
- # clojure-europe (39)
- # clojure-france (2)
- # clojure-italy (3)
- # clojure-losangeles (1)
- # clojure-nl (20)
- # clojure-uk (8)
- # clojurescript (24)
- # conjure (12)
- # datalog (9)
- # datomic (24)
- # emacs (8)
- # figwheel-main (1)
- # fulcro (15)
- # jobs-discuss (1)
- # malli (5)
- # meander (3)
- # off-topic (26)
- # re-frame (15)
- # reagent (10)
- # reitit (1)
- # reveal (1)
- # sci (15)
- # shadow-cljs (25)
- # spacemacs (7)
- # sql (3)
- # xtdb (1)
Asami 1.1.0 is now out. This has minor updates:
• Entity arrays are now returned as vectors and not lists.
• Entities now represent multi-arity attributes as a set of values. If more than one of an attribute is found, then a set of those values is returned in the entity. Similarly, providing a set will result in using the attribute multiple times in the graph.
• Arrays in entities can be appended to by using the +
annotation on attributes (see https://github.com/threatgrid/asami/wiki/Transactions#append-annotation for details)
• Queries now accept _
symbols as wildcards, and accept shortened constraints (not just triples)
It's mentioned in the docs that :db/ident
can be any data type, but I'm not having luck getting it to work with vectors as idents. Is it actually any scalar data type?
(def tx (d/transact conn {:tx-data [{:db/ident ["liz" 5] :name "Elizabeth"}]}))
(d/q '[:find [?n ...]
:where [?p :name ?n] [?p :db/ident ["liz" 5]]] (d/db conn))
(d/entity (d/db conn) ["liz" 5])
(d/q '[:find ?p
:where [?p :name ?n] [?p :db/ident ["liz" 5]]] (d/db conn))
yeah the 3 queries here and entity
call return nil
cljs.user=> (def tx (d/transact conn {:tx-data [{:db/ident ["liz" 5] :name "Elizabeth"}]}))
#'cljs.user/tx
cljs.user=> (pprint (:tx-data @tx))
([:tg/node-5 :tg/entity true 3 true]
[:tg/node-5 :db/ident :tg/node-6 3 true]
[:tg/node-6 :tg/first "liz" 3 true]
[:tg/node-6 :tg/rest :tg/node-7 3 true]
[:tg/node-7 :tg/first 5 3 true]
[:tg/node-6 :tg/contains "liz" 3 true]
[:tg/node-6 :tg/contains 5 3 true]
[:tg/node-5 :name "Elizabeth" 3 true])
That won’t work on buffer-backed indexes, but I think I can do it as a new datatype with edn
(I have no opinion on if it's a good idea or not, just starting to play with asami a little bit 🙂 )