This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2017-03-02
Channels
- # aws-lambda (1)
- # beginners (28)
- # boot (54)
- # cider (11)
- # clara (28)
- # cljs-dev (74)
- # cljsrn (13)
- # clojure (342)
- # clojure-austin (3)
- # clojure-dusseldorf (4)
- # clojure-france (2)
- # clojure-greece (11)
- # clojure-italy (42)
- # clojure-poland (7)
- # clojure-russia (11)
- # clojure-spec (44)
- # clojure-uk (156)
- # clojure-ukraine (4)
- # clojurescript (102)
- # cursive (17)
- # datascript (19)
- # datomic (17)
- # dirac (39)
- # emacs (22)
- # funcool (56)
- # hoplon (25)
- # jobs (3)
- # jobs-discuss (31)
- # leiningen (2)
- # luminus (4)
- # lumo (3)
- # off-topic (47)
- # om (51)
- # onyx (57)
- # re-frame (13)
- # reagent (57)
- # remote-jobs (15)
- # ring (9)
- # ring-swagger (7)
- # robots (2)
- # rum (6)
- # specter (16)
- # sql (7)
- # test-check (37)
- # untangled (7)
- # yada (5)
I have worked through the first 4 of http://www.learndatalogtoday.org/ . I am familiar with querying. However, I'm not familiar with (1) mutating and (2) database design. What can I read to learn up on (1) and (2).
for (2), try http://tonsky.me/blog/unofficial-guide-to-datomic-internals/ and http://tonsky.me/blog/datascript-internals/
for (1), all I ever needed is http://docs.datomic.com/transactions.html
Hey guys, I'm running into an error that doesn't make sense to me. I have the following function:
(defn authenticate
[username password]
(let [conn (get conns "users")]
(empty? (d/q '[:find ?e
:where
[?e :user/username username]
[?e :user/password password]]
@conn))))
But, if I run this function, I get the following error:
Cannot parse clause, expected (data-pattern | pred-expr | fn-expr | rule-expr | not-clause | not-join-clause | or-clause | or-join-clause)
.function arguments do not get passed to query magically. those need to be provided to q
explicitly, and then bound to variables inside a query vector too
(defn authenticate
[username password]
(let [conn (get conns "users")]
(empty? (d/q '[:find ?e :in $ ?u ?p
:where
[?e :user/username ?u]
[?e :user/password ?p]]
@conn username password))))
@qqq also (into {} my-entity)
works i think
but pull api is probably more "correct"
@thedavidmeister : yeah, pull api is the correct wya to go
i've been using pull a lot more recently
works better with hoplon
entities don't trigger cell propagation because of the way they do equality checks
but pull does 🙂