This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2016-06-30
Channels
- # admin-announcements (3)
- # aws-lambda (12)
- # beginners (88)
- # boot (73)
- # capetown (6)
- # carry (16)
- # cider (8)
- # cljsjs (7)
- # clojure (90)
- # clojure-belgium (4)
- # clojure-dev (19)
- # clojure-greece (41)
- # clojure-portugal (1)
- # clojure-quebec (4)
- # clojure-russia (25)
- # clojure-spec (172)
- # clojure-taiwan (1)
- # clojure-uk (76)
- # clojurescript (82)
- # cursive (37)
- # datavis (2)
- # datomic (46)
- # devcards (1)
- # emacs (4)
- # euroclojure (6)
- # events (1)
- # hoplon (31)
- # jobs (1)
- # keechma (9)
- # off-topic (4)
- # om (7)
- # onyx (65)
- # other-languages (15)
- # pedestal (1)
- # planck (50)
- # proton (1)
- # re-frame (40)
- # reagent (7)
- # spacemacs (14)
- # spirituality-ethics (37)
- # testing (1)
- # untangled (2)
- # yada (44)
Hi all, I have this existing system that uses a trad ORM with the party model. Party is a base entity that has children of either an Org or a Person. Whats the way to approach such a thing with datomic ?
@len divide the attributes into :party/attributes, :org/attributes and :person/attributes
yep, you just get things which have one or more of the attributes you're interested in, you don't have to think in terms of models and inheritance like a trad ORM
If you’ve got many :refs associated to an attribute, how do you remove one of them from the list?
@zentrope: simply transact a retraction
[:db/retract entity-id :my-ref-atrib current-value]
Yes, I have something like :product/orders :many. I just want to retract one of those orders.
if you want to retract the whole order entity you’ll need to handle that separately
you might also want to have a look at http://docs.datomic.com/transactions.html#built-in-transaction-functions specifically the retractEntity function - if you ever want to remove the order itself and all references to it
[::db/retract [:product/id “asda”] :product/orders [:order/id “asa”]]
<— that sort of thing (pseudocode)?
the pseudocode you have there says something along the lines of “i have an entity with :product/id “asda” and it has a bunch of references through the attribute :product/orders. one of those references is to an entity that has the attribute :order/id “asa” and I want to remove that reference from the “asda” entity"
[:db/retract 277076930200665 :spec/controls [:product/id "a82f5914d899edc259c96303e89133299f14b635”]]
Hm. I’m getting an “invalid list form” even with proper eids. Must be something else.
Oh, I see. I’m just adding the retract/asserts as a value to an attribute in a map, rather than just concatting them on to the TX itself.
when i try to compile my app, it starts a peer connection and i go over my peer limit. Do people typically have a def like this (def conn (d/connect uri)) or do you set the connection as an atom var on start ?
@jdkealy: the component (Stuart Sierra’s lib) example here is the typical way I see people approach this (also some other good advice in the blog post in general): http://www.rkn.io/2014/12/16/datomic-antipatterns-eager-conn/
datomic newbie here—is there any way for me to introspect into the schema itself?
...assuming that's a meaningful question
Yeah, it's just data and you can query it. https://github.com/Datomic/day-of-datomic/blob/master/tutorial/schema_queries.clj
@bkamphaus: just the sort of thing I was looking for—thanks so much!
im confused about what peers might be connected. is there some way to reset them all ?
Killing the process or calling release for a peer is sufficient, transactor will log all ips connected.