This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2015-10-13
Channels
- # admin-announcements (48)
- # alda (1)
- # aws (24)
- # beginners (4)
- # boot (103)
- # cider (69)
- # clojure (111)
- # clojure-art (5)
- # clojure-dev (35)
- # clojure-greece (2)
- # clojure-nl (3)
- # clojure-russia (1)
- # clojure-shanghai (1)
- # clojurescript (220)
- # clojurescript-ios (1)
- # clojurewerkz (3)
- # community-development (3)
- # core-logic (5)
- # cursive (5)
- # datomic (24)
- # devcards (21)
- # editors (3)
- # funcool (1)
- # hoplon (20)
- # ldnclj (47)
- # ldnproclodo (1)
- # liberator (1)
- # off-topic (7)
- # om (21)
- # onyx (36)
- # reagent (1)
- # ring-swagger (2)
- # spacemacs (38)
- # yada (17)
@peterbak: we’re doing exactly that. web-based SaaS, Clojure/ClojureScript/Datomic/AWS/DDB. happy to answer your questions. custom dashboards for sure.
admin data access is just as business focused as end-user data access. console is not sufficient at all.
Can anyone help me understand why quoted tx-vector '[[:db.fn/retractEntity 17592186047366]]
works here:
@(datomic.api/transact (datomic.api/connect db-url) '[[:db.fn/retractEntity 17592186047366]])
but does not work here:
((defn delete-entity [conn id] @(d/transact conn '[[:db.fn/retractEntity id]])))
?
;; quoted tx-vector inside function:
(defn delete-entity [conn id]
@(d/transact conn '[[:db.fn/retractEntity id]]))
(delete-entity (d/connect db-url) 17592186047368)
=> {:db-before datomic.db.Db@b0c105bd, :db-after datomic.db.Db@6c30bdd6,
:tx-data [#datom[13194139536294 50 #inst "2015-10-13T13:22:44.104-00:00" 13194139536294 true]], :tempids {}}
;; unquoted tx-vector inside function:
(defn delete-entity [conn id]
@(d/transact conn [[:db.fn/retractEntity id]]))
(delete-entity (d/connect db-url) 17592186047368)
=> {:db-before datomic.db.Db@6c30bdd6, :db-after datomic.db.Db@e6202e4c,
:tx-data [#datom[13194139536295 50 #inst "2015-10-13T13:26:42.812-00:00" 13194139536295 true]
#datom[17592186047368 121 "b" 13194139536295 false]], :tempids {}}
;; quoted tx-vector w/o function
@(datomic.api/transact (d/connect db-url) '[[:db.fn/retractEntity 17592186047366]])
=> {:db-before datomic.db.Db@7e5e4260, :db-after datomic.db.Db@c732de53,
:tx-data [#datom[13194139536296 50 #inst "2015-10-13T13:30:25.865-00:00" 13194139536296 true]
#datom[17592186047366 121 "a" 13194139536296 false]], :tempids {}}
@misha not sure why you’re using the quoted form?
@bkamphaus: I'm not sure either
but in the second case you’re not passing the evaluated var, you’re passing the symbol (b/c it’s in a quoted coll)
I’m probably not being as precise as I mean to.
But you’re not binding a value to the id symbol in the scope of the fn, without delving into how it gets treated or eval’d on the other side
ok, then what makes it work, when I am passing the same quoted vector to d/transact directly? what happens/does not happen if the same "text" gets wrapped up in a function. does it have something to do with the clojure's reader? what should I read about this?
the main thing is, transact is intended to take vecs, not quoted vecs
@misha you don’t pass the same quoted vec
in your example, you pass one with the value in it, not the symbol
makes sense. this does not work either:
(let [id 17592186047360]
@(datomic.api/transact (datomic.api/connect w.db/db-url) '[[:db.fn/retractEntity id]]))
@bkamphaus: cheers
Datomic 0.9.5327 is now available https://groups.google.com/d/msg/datomic/4BwCDxs6zKw/xRe-1uYqCQAJ
@robert-stuttaford: ^ addresses your issue from a few days ago, with: > * Bugfix: Fixed bug that prevented connecting from a peer that deletes and recreates a database name.
I’m sure there are other interested parties in that one lurking here as well…
@bkamphaus: -applause- -celebration- thank you!