This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2016-11-07
Channels
- # aleph (11)
- # aws (8)
- # bangalore-clj (4)
- # beginners (32)
- # boot (48)
- # cider (2)
- # cljs-dev (57)
- # cljsrn (4)
- # clojars (22)
- # clojure (67)
- # clojure-argentina (2)
- # clojure-austin (9)
- # clojure-berlin (1)
- # clojure-brasil (15)
- # clojure-france (1)
- # clojure-italy (10)
- # clojure-russia (23)
- # clojure-spec (6)
- # clojure-uk (48)
- # clojurescript (143)
- # cursive (15)
- # datomic (30)
- # emacs (18)
- # hoplon (26)
- # instaparse (1)
- # leiningen (1)
- # om (21)
- # om-next (9)
- # parinfer (3)
- # pedestal (3)
- # planck (2)
- # re-frame (53)
- # reagent (4)
- # ring (5)
- # spacemacs (1)
- # specter (10)
- # sql (16)
- # untangled (19)
- # vim (11)
- # yada (2)
any notes on using postgress on heroku with datomic. pointers can also help
rnandan273: there are buildpacks out there you can use
Handles most of it
@teng, honestly I'm now just adding attributes, created-at and updated-at
Saves you a lot of hassle, and is faster to query
@pesterhazy An idea I had was to store the transaction id instead and then “join” it with the transaction entity to get the date/time. That felt more right to me, but maybe there are downsides to that?
I wouldn't rely on that
When making db dumps, entity ids get changed
Not normal backups but selective db dumps
Also you'd have to update the entity each time you update as the transaction changes
So you might as well store the date directly
Relying on transaction metadata makes it harder to re-transact data without losing information
They should have a similar thing as d/basis-t for entities (the current t for an entity), then you could just join in the transaction and get the date/time.
I think it's best to avoid relying on metadata except for audit and historical analysis
For example transact the user name that initiated the tx
For that kind of thing it's awesome
So some type of dumps recreates all the transaction id’s, which makes it a bad idea to store transaction ids as facts?!
That's just my opinion
But think of the use case of recreating a db selectively
Or developer db dumps for testing
Makes sense.
Can I ask the database to give me the current date/time? Otherwise, it can be a problem if I’m running more than one transactor on different machines (if their clock is not in sync).
Yes, in a db.fn that should work
You could create a touch
fn that updates the timestamp for you
Note that the fn will run on the transactor
But only one transactor is ever active so there shouldn't be contention there
Say is there a predicate I can use that will tell me whether a value is an entity returned from (d/entity)
or not?
Hmm, looks like #(instance? datomic.Entity %)
does it. I do peculiarly get a NullPointerException doing #(satisfies? datomic.Entity %)
for some reason though
Ah, because it's a class. The wording of this in the docs led me to believe it was an attribute. http://docs.datomic.com/clojure/index.html#datomic.api/entity