This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2016-04-11
Channels
- # admin-announcements (2)
- # beginners (53)
- # boot (151)
- # cider (11)
- # cljs-dev (60)
- # cljsrn (36)
- # clojure (71)
- # clojure-austin (13)
- # clojure-berlin (2)
- # clojure-czech (11)
- # clojure-dev (35)
- # clojure-dusseldorf (2)
- # clojure-france (6)
- # clojure-japan (9)
- # clojure-russia (183)
- # clojure-uk (18)
- # clojurescript (155)
- # cursive (6)
- # datomic (25)
- # euroclojure (6)
- # funcool (6)
- # hoplon (229)
- # instaparse (10)
- # jobs (9)
- # leiningen (5)
- # off-topic (70)
- # om (29)
- # onyx (18)
- # planck (1)
- # proton (5)
- # re-frame (8)
- # reagent (32)
- # untangled (4)
Does anyone know if there’s a way that I can wrap a Datomic connection and log all the calls that get made to it? I’m working with some inherited spaghetti code and it’s not unusual for me to have no idea when certain kinds of entities are created or updated. My hope is that I can log the events I care about so I can work out what code is responsible. Ideally I’d get a stack trace at those times.
could you make a core async channel which you use to talk to datomic? so rather then calling something directly you put it into the channel which will then do the actual call. then the channel could do arbitrary things, like maybe log something to a file
The way this thing is built there are a whole bunch of auto-magic macros that wire up functions and local mutable state into a graph. I have control of the place where the connection comes from, but the other functions are littered across the code base, so it is currently impractical to refactor. As such I don’t think a channel will help. Thanks though.
It looks like I can probably use the [transaction report queue](http://blog.datomic.com/2013/10/the-transaction-report-queue.html) for my needs.
@adamkowalski: I found a promising lead that uses core.async here: https://github.com/thegeez/gin/blob/master/src/gin/system/database_datomic.clj#L127 Thanks for the suggestion.
Is there a simple way to run a query that matches a given string against one of a few attributes? For example, something like this pseudocode: :where [?user :user/email ?string] :or [?user :user/name ?string]
Query syntax supports or
— check the docs for the correct syntax
It was because I'm using clojure.string/includes?
to check for a substring of any of these. Which exploded the query into a bunch of temporary variables which I then check with or, and needed to bind with or-join
.
Or lets you test different values of the same attribute, but if you want to (say) search for a string among a few attributes, the rule stuff was what worked for me.
Here was my in-a-pinch solution: https://gist.github.com/zentrope/aea55ff520da2fad85837c4ce6514222
@zentrope: Ahh, I see why that works. Per the docs: "Rules with multiple definitions will evaluate them as different logical paths to the same conclusion (i.e. logical OR)."
Anyone have any experience with Adi? https://github.com/zcaudate/adi
@zane: @zcaudate hangs out mostly on his gitter https://gitter.im/zcaudate/adi answers loads of questions there