This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2017-01-17
Channels
- # aws (2)
- # beginners (34)
- # boot (39)
- # cider (28)
- # cljs-dev (2)
- # cljsrn (30)
- # clojure (195)
- # clojure-austin (6)
- # clojure-dev (6)
- # clojure-dusseldorf (1)
- # clojure-france (1)
- # clojure-russia (139)
- # clojure-spec (25)
- # clojure-uk (66)
- # clojurescript (125)
- # community-development (1)
- # core-async (42)
- # cryogen (1)
- # cursive (22)
- # datascript (6)
- # datomic (67)
- # docker (1)
- # emacs (7)
- # events (1)
- # garden (3)
- # hoplon (15)
- # jobs (3)
- # lein-figwheel (10)
- # leiningen (3)
- # luminus (4)
- # mount (2)
- # nginx (1)
- # off-topic (101)
- # om (42)
- # om-next (6)
- # onyx (7)
- # proton (1)
- # protorepl (4)
- # re-frame (15)
- # reagent (30)
- # remote-jobs (1)
- # ring (8)
- # ring-swagger (17)
- # rum (1)
- # spacemacs (2)
- # sql (1)
- # yada (50)
hey has anyone looked at datomic as a chat backend? We’re looking at some chat features taht need to be pretty tigthly integrated with an in-house app. I was thinking that streaming the tx log would make it effectively ‘reactive'
@eoliphant datomic doesn't scale writes well and has some practical datom limits. Not saying its impossible but it's probably not a good fit
So I just downloaded datomic-free & tried to install the console into the extracted datomic directory. Launching the console, I get Exception in thread "main" java.lang.IncompatibleClassChangeError: Implementing class
.
Is it no longer possible to run the console with the free edition ?
@pseud I don't think that was ever possible because the free version does not have a transactor, which is the thing you have to connect the console too
@pseud @mitchelkuijpers You should be able to use console with free and you do have a transactor with free. You have to download console separately and install it into the datomic install directory. I just tested and got the same error so I am thinking we might have broken something with standalone console. I am currently investigating to figure out what exactly broke
For free you run a free protocol transactor with:
bin/transactor config/samples/free-transactor-template.properties
@jaret Did not know that, sorry
It can definitely be confusing because of the free protocol, but as long as you aren't using an in MEM db you can connect console to it
Yea, that was my understanding from reading the guides too. I'm guessing the problem now stems from some compiled code which console depends on being different between free & pro bundles. I wonder if console shouldn't just be bundled in with free these days, given its availability to free users also ? Why the extra hoops to jump ? I'm already committing to learning a new query language, use a proprietary closed-source, one-off database - seems like that's enough commitment. I know that comes off as a bit mean, but understand that leadership adopts a technology, and other employees (such as I) are forced to come to terms with it. Jumping through hoops to approach feature-parity (in terms of dev tooling) only breeds resentment.
I understand where you are coming from. I would suggest that you register for Starter edition(its free for registered users). Its identical to PRO in all respects and comes bundled with console. I think that would get you going and working.
Is there a simple way to clear the object cache for benchmarking sake?
And on an unrelated note is is possible to limit a many cardinality ref relationship in datalog, so that the where clause only applies to the newest?
[?entity :likes ?items]
[?items :attr val]
Does the limit
expression in the pull API guarantee any kind of order newest/oldest first? If so, can this be manipulated?For integration purposes we're looking at using squuids as unique identities for all our entities (about 20 now), but I'm not fully grasping the respective trade-offs of reusing a global :db/uuid
attribute vs. a per-entity :<entity>/uuid
attribute. Concerned about impact on performance and indexing I guess?
Is there a way to get all datoms associated with an entity? I’m trying to send a filtered version of my database down to a datascript client. My schema has a clear separation of data at the :organization
entity level (all datoms pointing from there can be sent to the client).
@seantempesta Dont know if is your case, take a look at touch method? http://docs.datomic.com/entities.html
@lellis: Interesting. So (d/entity (d/db conn) 17592186047972)
and then traverse that for a list of :db/id
, calling (d/datoms (d/db conn) :eavt %)
on each entity id?
@seantempesta I usually just do pull
and then send that data to the client, datascript will also be fine with nested maps, given a proper schema. So pretty simple overall
@rauh: Sorry. Not sure if I follow. Do you have the relevant code snippet?
But if you want more magic, then I agree with lellis: Walk the entity along and send that map.
(d/pull eid [:post/id :post/title {:post/comments [:comment/id]}] [:post/id post-id])
e.g.
but you have to manually opt in for every entity, no magic involved. Which might be what you want in case you store secrets in the db in the future
@seantempesta no, i mean
(d/touch (d/entity (d/db conn) 17592186047972))
will initialize all entity attributes.Don’t I need to get the individual datoms to transact on the datascript side?
Okay. I’ll try that. Thanks!
@rauh: Okay, so transit wasn’t able to encode the entity map. java.lang.Exception: Not supported: class datomic.query.EntityMap
. Am I missing a step?
@seantempesta A pull shouldn't return an entity
Oh right. I was still using the d/entity
@seantempesta You can try this code: https://github.com/zalf-lsa/berest-castra-service/blob/997023a9c4000ef4870c0f59802afbc990bb3c2d/src/de/zalf/berest/web/castra/api.clj
how would i do something like the following: I have a permission that might be tied to a user and a user has an email, or a permission is "pending" and would have an email associated directly. https://gist.github.com/jdkealy/50b1e64f27f5973054b0ce99c313de95
Trying (or ) gives me the error Assert failed: All clauses in 'or' must use same set of vars, had [#{?email ?user ?e} #{?email ?user}] (apply = uvs)
that still doesn't seem to work either... same error (d/q '[:find ?e ?email :in $ ?ent :where [?e :permission/ent ?ent] [?e :permission/user ?user] (or [?user :user/email ?email] [?e :permission/email ?email])] _db id)
also i think even if that did work, none of the permission/email would return because they don't have a permission/user @favila
sorry, it's... either [?permission :permission/email ?email] or [?user :user/email ?email]
[:find ?e ?email
:in $ ?ent
:where
[?perm :permission/ent ?ent]
(or-join [?perm ?email]
[?perm :permission/email ?email]
(and
[?perm :permission/user ?user]
[?user :user/email ?email]))]
by default or
tries to unify all its vars with the surroundings, but you had different vars in each half of the or, so it could not do that
or-join
restricts the unification with what is outside the clause to only the vars mentioned, essentially allowing ?user
to act as a kind of private variable only unified within its clause
Hello all! I have an interesting problem...I'm using Pedestal/Datomic combination and when I use retractEntity function to retract an entity all of my other data clears on the site until (I believe) I run a pull at a very top level entity. I get a new "db" for every request so I'm not sure why it actually takes "pull" on a top level entity to get the data to come back...
@tmorten hmm... not knowing much about pedestal, how does it merge in new data when you get it?
@sova: I have an interceptor wrapper per request that injects a new "(d/db conn)" into my request chain. So essentially, every page refresh I would get a new datomic db...what is odd is that, I experience this at the REPL too... I retract the entity...get a new db per (d/db conn) and begin to query the db...which I am left with ONLY entity IDs and no other associations. Doesn't come back until I (d/pull ... a top level entity). For what it is worth, I am retracting an entity that was linked to that entity...
Hmm.. Would you mind posting the lines you are using to retract? I'm interested in getting to the root of your issue... will read a bit about pedestal
@tmorten ... follow-up question, So when you say "top level entity" what do you mean?
because in my use with Datomic all the entities just kinda live in a big ... entity ocean
Yeah, sorry. By top level I mean it has association to entity I am retracting. In a one many assoc
looks good to me.. let me check it against my typical code...
Hmm so for my retracts
they look like this
(defn remove-blurb [bid]
(let [blurb-info (get-blurb-by-bid bid)
b-title (:title (first blurb-info))
b-content (:content (first blurb-info))
b-author (:publisher (first (get-publisher-email bid)))]
(d/transact conn [[:db/retract bid :blurb/title b-title]
[:db/retract bid :blurb/content b-content]
[:db/retract bid :author/email b-author]])))
So maybe you are losing attributes because you're not specifying on which attribute+val it should remove. Do you know more about the entity you want to retract? If you do, you could supply the :werds/ident and the "value" @tmorten