Fork me on GitHub
#datomic
<
2018-03-05
>
drewverlee01:03:29

In datomic whats the mechanism by which you reference another entity when doing a transaction when that entity isn’t in the db yet? something like:

[{:db/id -1
  :person/name "sally"}
  {:person/name "joe"
    :person/spouse -1}
]
I’m not sure how to even phrase the question properly.

drewverlee01:03:37

maybe this section on temp ids is what i want: https://docs.datomic.com/on-prem/transactions.html#temporary-ids, There is no way to combine that with the map form insert?

devn01:03:54

@drewverlee yeah that’s basically it. There are examples in the day of datomic repo that I think show this.

devn01:03:33

Let a tempid and then reference it in the transaction elsewhere

drewverlee02:03:33

maybe i have an old version of something

drewverlee17:03:02

turns out i just didn’t tell the schema it was a ref. I wasn’t sure that was necessary in dataScript.

alexmiller03:03:42

You can now use strings as temp ids

ignorabilis08:03:18

hi, is there a simple way to hook an on-change sort of handler? I want to monitor all transactions and if a transaction adds/retracts a value for a specific entity to invoke a side-effectfull function

ignorabilis14:03:05

@U2J4FRT2T - Sorry, I meant Datomic Cloud.

souenzzo14:03:31

Check if there is somethink like tx-report-queue on client api reference if there isn't, there's no support. 😕 you may suggest this feature on http://receptive.io (top right corner on http://my.datomic.com)

ignorabilis10:03:03

@U2J4FRT2T - Thanks. Unfortunately there isn't and that's why I asked. I will vote/suggest this feature though.

petterik09:03:54

Is there a way to use the datomic.client.api against an in-memory database/connection? Keeping everything in the same process

jaret14:03:42

@petterik No — on-prem requires a peer server to use the client API which would break your “in the same process” req.

petterik14:03:18

Ok. Makes it a bit harder when developing stuff, not being able to create/destroy connections in-memory on the fly. An in-memory "peer-server" would be nice to have

uwo18:03:44

I have a question about how to approach data migrations. I understand that if you follow the best practices for schema growth, older versions of an application will always have the appropriate schema available. My question is, should it be a goal to also have inverse data migrations (“down” data migrations), so that earlier versions of the app can be run in a dev setting?

drewverlee18:03:36

With the pull api, is there a limit to how many relationships you can follow? Eg to get great grandson son >son>son

souenzzo19:03:43

This {:persn/friends 6} is a new feature? Sometime ago I wrote a spec for pull pattern and I do not remember seeing this specification

favila19:03:34

no, not new

favila19:03:30

the grammar may have been wrong (happens frequently)

favila19:03:37

but the feature was always there

favila19:03:28

I think the grammar in the docs is hand-written from their implementation; it's not copy-pasted from a parser generator's input

drewverlee21:03:50

Thanks Favila, ill look at this when i get home

drewverlee02:03:57

@U09R86PA4 Your right my example would work with recursion. Thanks! I guess i should have given my actual problem! In my case the relationships aren’t always the same, in fact each ref is different.

drewverlee02:03:47

This might be better suited for the logic programming side of datomic i suppose