Fork me on GitHub
#datomic
<
2019-10-13
>
steveb8n00:10:08

@dustingetz I’ve rolled my own. You could do this in a txn fn or (in my case) in the client that sends the tx data. it’s pretty straightforward to do. you do need a cross-cutting fn to lift idents, re-shape ordered cardinality-N attrs etc.

steveb8n00:10:52

you are right that this would be a nice lib if it existed. I hope that we will see something like this as an add-on from Datomic/Cognitect (maybe when spec2 is nailed down) but, until then, it’s roll your own

steveb8n00:10:41

if you use the ideas in this post, it becomes much easier https://cjohansen.no/referentially-transparent-crud/

Dustin Getz02:10:59

how about the query side - datomic pull and s2/select

steveb8n04:10:11

same thing. you need a cross-cutting fn to translate. In my case I composed the pull expr for each entity into the query variety of each entity so that the translate fn can be used for pull or query.

steveb8n04:10:47

thinking about this: you could use the spec describe to drive the translate fns. slightly more complex but then fully generic i.e. much less boilerplate