This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2016-09-21
Channels
- # alda (1)
- # bangalore-clj (1)
- # beginners (7)
- # boot (88)
- # carry (2)
- # cider (8)
- # cljs-dev (60)
- # cljsjs (2)
- # cljsrn (45)
- # clojure (255)
- # clojure-belgium (5)
- # clojure-boston (1)
- # clojure-dusseldorf (3)
- # clojure-greece (49)
- # clojure-italy (10)
- # clojure-russia (30)
- # clojure-spec (78)
- # clojure-uk (11)
- # clojurebridge (1)
- # clojurescript (80)
- # cursive (14)
- # datomic (33)
- # defnpodcast (4)
- # devcards (2)
- # dirac (15)
- # editors (23)
- # emacs (5)
- # events (11)
- # funcool (1)
- # hoplon (1)
- # juxt (1)
- # luminus (2)
- # mount (7)
- # off-topic (15)
- # om (152)
- # om-next (2)
- # onyx (17)
- # parinfer (1)
- # proton (38)
- # re-frame (35)
- # reagent (110)
- # rum (3)
- # spacemacs (3)
- # specter (51)
- # test-check (2)
- # testing (5)
- # untangled (234)
@bahulneel @ethangracer Thanks! This is really cool...
For now, since it's inside another pull (I need one-level deep attributes of one of the attributes of a pull
), I'm defining which attributes are used :
(d/q '[:find [?an ...]
:in $
:where
[?e :whatever/value ?m]
[?m ?a _]
[?a :db/ident ?an]]
(d/db conn))
and I use this one inside a pull like:
...
whatever-attributes (d/q '[:find [?an ...]...) ;; query above
attributes [:whatever/id
:whatever/value whatever-attributes]
find `[[(~'pull ~'?e ~attributes) ...]]
...
(d/q `{~':find ~find
~':in ~in
~':where ~where})
@kurt-yagram awesome! take a look at the following tutorial to see how you can parameterize your queries, so that you don’t have to inject them using syntax quotes, etc. which is both time consuming and hard to get right http://www.learndatalogtoday.org/chapter/3
@ethangracer yeah, I didn't like all the syntax-quote stuff... didn't think of parameterizing it though, stupid me. I only parametrized single values so far. Thx!
@kurt-yagram I just discovered the full power of datomic’s parameterization too. It’s pretty fantastic.
from datomic docs:
(d/q '[:find ?p (pull ?tx [:db/txInstant]) ?added
:in $ ?userid
:where [?u :user/purchase ?p ?tx ?added]
[?u :user/id ?userid]]
(d/history db) userid)
However, when I try something like that, I get IllegalStateException Can't pull from history datomic.pull/pull* (pull.clj:294)
So... when did that change?@kurt-yagram Where in the docs is that example? I’ll fix it.
## Changed in 0.9.5344
* Improvement: Throw error when datomic.api/pull
is passed a history db.
@marshall why was it decided that pull couldn’t be used on a history db?
@ethangracer it never would have worked, the improvement was to throw when tried. The semantics of pull are current-schema-dependent
@marshall Interesting. Is there any documentation / talks about why that is? I’m curious to understand more
@kurt-yagram thanks. i’ll fix that
just a quick question: if an entity is retracted, and that entity is a component of other entities, it's retracted from the parent-entities as well. Also, all components of the retracted entity are retracted - I never used retract so often in 1 sentence. However, can I add the retracted entity again? What will happen? Will it restore the old state, like, add previously retracted components? Will it be added as a component to the previously parent, where it was a component of? (Does this actually make any sense?)
that all depends what you mean by 'add the retracted entity again' 🙂
Does anyone know if it's possible to know if a variable is already bound in a rule?
@kurt-yagram: remember that it's all just datoms. [this-e :value ":-)"] [this-e :relationship that-e] [that-e :value " 😎 "]. if you restore these datoms, you restore those entities and their relationships
Datomic becomes crystal clear when you understand this fact, imho
I’m thinking the history would be really useful for analytics and the peer cache should mitigate performance concerns, but I don’t know if there are reasons why this would be a bad idea…?
One question I might consider is the total volume of sessions you expect to need to handle over time
if you only want to keep sessions around for a few days (or however long), you’d have to address how to handle that
evidently a couple folks have indeed thought about it at least: https://github.com/gfZeng/datomic-session-store https://github.com/hozumi/datomic-session Caveat - I have no personal knowledge of these repos and their value/quality/live-ness/etc 🙂
Maybe having a session/key that doesn’t track history could be a way to invalidate them while keeping the data around?
You could definitely use noHistory. of course then you don’t get the benefit of having history for audit/metrics/debugging/etc
but unless you have a really busy site, the overall data volume will likely not be prohibitive even if you keep everything
silly question - is Cognitect aware that
has an invalid SSL cert on it (cert is for
, Safari on (i|mac)OS 10 at least carps about the hostname mismatch)?