This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2016-02-29
Channels
- # admin-announcements (6)
- # announcements (1)
- # beginners (1)
- # boot (104)
- # braid-chat (5)
- # cbus (1)
- # cider (2)
- # clojure (147)
- # clojure-japan (1)
- # clojure-poland (1)
- # clojure-russia (31)
- # clojurescript (16)
- # core-async (4)
- # css (2)
- # cursive (14)
- # datomic (40)
- # devcards (5)
- # dirac (100)
- # emacs (5)
- # funcool (1)
- # immutant (52)
- # juxt (4)
- # ldnclj (128)
- # lein-figwheel (12)
- # leiningen (26)
- # luminus (3)
- # mount (22)
- # off-topic (11)
- # om (144)
- # onyx (2)
- # parinfer (1)
- # proton (7)
- # re-frame (55)
- # reagent (16)
- # slack-help (5)
- # yada (1)
@greywolve: Hey! I was going to ask that!
so yeah, just to make it clearer – is there any case where clause order has an influence on the result of a query (other than impacting the query time)? Particularly when using not clauses
Clause order never has an impact on the result of a query.
From http://docs.datomic.com/query.html
"Datomic will attempt to push the not
clause down until all necessary variables are bound, and will throw an exception if that is not possible."
thanks – so, I currently have in front of me a query where, depending on the placement of the not
clause vs a missing?
clause, the result differs 😕
Not having seen the query, my first guess is that this would be caused by different variables being bound in the not
clause from the missing?
clause.
I don't think so.
I think we would have to see a minimal test case to explain what was happening.
If you don't get an answer on Slack, I would suggest posting the question to the Datomic mailing list.
You're welcome, sorry I didn't have an easy answer ready.
np – I totally understand you can't do much without some actual code you can run on your side
@achesnais: One thing, datomic.peer
is not a public API.
Also the reader literal #db/id
is not meant for use in Clojure code.
And you can't transact an attribute in the same transaction in which it was defined.
After fixing those things, though, I get the same result you reported.
I admit I don't entirely understand what is happening.
It could be some subtlety related to the joining variables in not
clauses.
It might even be a bug.
okay cool, glad someone else can reproduce. Sorry about the newbiness of my snippet
If I am making a client for the rest API in Clojure (or actually a home made one, but still using EDN), what is a good way to make tempids if I don’t have a dependency on the datomic.api in the client?
Datomic newbie here. Do you guys usually manage your schemas directly, or do you use a tool like datomic-schema? Writing schemas seems to involve a lot of boilerplate
@casperc: Create your own datatype and render it in EDN as #db/id[:partition]
@stuartsierra: I was actually going that way just now, I am just not sure how to make the rendering work:
(defprotocol IPrintable (toString [this]))
(deftype DbId [partition id]
IPrintable
(toString [this]
(str "#db/id[" (keyword partition) (when id " " id) "]")))
=> (pr-str (->DbId :db.part/id nil))
"#object[common.datomic.client.DbId 0x57a76d2f \"#db/id[:db.part/id]\”]”
Look at the definition of pr
in ClojureScript to see what protocol or multimethod it's using.
@stuartsierra: Tricky, I was looking in Clojure’s definition, but that didn’t tell me too much tbh. I’ll look in CLJS
Ah, actually it ends up in the print-method multimethod, so I would probably need to add a defmethod for that
@stuartsierra: It works, thanks for the pointer.