This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2017-06-27
Channels
- # bangalore-clj (2)
- # beginners (37)
- # boot (16)
- # cider (17)
- # clara (4)
- # cljs-dev (351)
- # cljsrn (16)
- # clojure (219)
- # clojure-belgium (4)
- # clojure-dev (3)
- # clojure-france (2)
- # clojure-italy (24)
- # clojure-russia (23)
- # clojure-spec (55)
- # clojure-switzerland (3)
- # clojure-uk (89)
- # clojurescript (121)
- # cursive (2)
- # datomic (29)
- # devops (2)
- # graphql (8)
- # hoplon (15)
- # immutant (5)
- # lein-figwheel (4)
- # liberator (3)
- # luminus (18)
- # off-topic (9)
- # om (6)
- # onyx (31)
- # pedestal (48)
- # precept (9)
- # re-frame (19)
- # reagent (63)
- # ring-swagger (69)
- # robots (1)
- # slack-help (14)
- # spacemacs (12)
- # sql (2)
- # test-check (4)
- # unrepl (28)
- # untangled (5)
- # yada (3)
hmaurer: (imho) perf tests for DBs are notoriously bad at providing real information because so many factors are at play in DB usage
how to query [:find ?u :where [?u :user/games ?g] [?g :game/finish? true]]
, but I want just users that have more then 5 games Finished?
@souenzzo have you tried adding clauses [(count ?g) ?gc] [(< 5 ?gc)]
?
robert-stuttaford: [:find ?u ?gc :where [?u :user/games ?g] [?g :game/finish? true] [(count ?g) ?gc]]
=>
UnsupportedOperationException count not supported on this type: Long clojure.lang.RT.countFrom (RT.java:646)
@marshall it seems my performance issue is fixed by this rewrite of my :find
method. Instead of a :find
+`pull` I do :find
+`:find`
@matthewdaniel I get that and completely agree, but does it warrant forbidding people from doing it in the T&Cs?
@hmaurer i think you mean @matthavener
shrug its much easier to forbidden someone from doing X then forbid them from doing X “badly” 😄
what’s the best way to get the datoms transacted in the transaction I have a ref to within a db function?
@dm3 the transaction id is the entity ID of that reified transaction
You can use the log API (specifically the tx-data
function) with that entity ID to get all the datoms: http://docs.datomic.com/log.html#sec-2
marshall: How to get all transactions between 2 db's? My scenario:
(let [db-before @(d/sync conn)
result (response-for pedestal-integration-test)
db-after @(d/sync conn)]
)
(let [_ @(d/transact conn [{:user/name "should not see"}])
before @(d/sync conn)
_ @(d/transact conn [{:user/name "should see"}])
after @(d/sync conn)]
(d/tx-range (d/log conn) (d/next-t before) (d/next-t after)))
Using basis-t, I get just the unwanted tx.
With next-t works!I assume it is a common/best practice not to rely on Datomic’s internal entity ID’s and instead add an “uuid” attribute?
@marshall sorry, I’ve got another question. How do peers obtain the connection details to the underlying storage? From the transactor?