Fork me on GitHub
#hyperfiddle
<
2018-11-21
>
alexandrkozyrev09:11:09

@dustingetz can you please explain how can I query/pull a particular entity, my naive approach “pull” [:db/id :intent/def] 17592186046681 didn’t help - http://alexandrkozyrev.hyperfiddle.net/:intent-bad-name-editor/

Dustin Getz12:11:02

To address an entity, you probably want to link to it. So look at http://tank.hyperfiddle.net/:tutorial.race/ and note the tooltips on the link. Then click the link and see the entity is in the URL. The link/formula is the "Excel formula" that controls what goes into the URL (There may not be a valid reason anymore to change this from the default, we aren't sure)

Dustin Getz12:11:17

Another interesting demo is http://tank.hyperfiddle.net/:clojurians/ – hover over #clojure, see the tooltip, and find it in the links table. This demo uses link/class, which is just an extra identifying keyword that doesn't do anything (like HTML lets you use a class to name a div, <div class="channel">). We use the :link/class from the :fiddle/view in order to place the links

Dustin Getz12:11:37

For debugging, you can craft your own URL to an entity, or you can use :fiddle/query with a grounded db/id, but this is generally not what a real app wants

alexandrkozyrev14:11:49

Dustin, can you please show an example of :fiddle/query with a grounded db/id, I’ve tried - http://alexandrkozyrev.hyperfiddle.net/:intent-bad-name-editor/

Dustin Getz14:11:55

Ground is like clojure.core/identity except a special Datomic version that is optimized for constants, it is a hint to the datomic query optimizer

Dustin Getz12:11:02

To address an entity, you probably want to link to it. So look at http://tank.hyperfiddle.net/:tutorial.race/ and note the tooltips on the link. Then click the link and see the entity is in the URL. The link/formula is the "Excel formula" that controls what goes into the URL (There may not be a valid reason anymore to change this from the default, we aren't sure)

Dustin Getz12:11:17

Another interesting demo is http://tank.hyperfiddle.net/:clojurians/ – hover over #clojure, see the tooltip, and find it in the links table. This demo uses link/class, which is just an extra identifying keyword that doesn't do anything (like HTML lets you use a class to name a div, <div class="channel">). We use the :link/class from the :fiddle/view in order to place the links

Dustin Getz12:11:37

For debugging, you can craft your own URL to an entity, or you can use :fiddle/query with a grounded db/id, but this is generally not what a real app wants