Fork me on GitHub
#datascript
<
2016-06-15
>
conaw05:06:53

I wrote a few specter functions for turning nested data structures into datascript transactions It will find all the nested maps inside a composite datastructure, assign each of them a temporary id, then it'll pull it apart into a list, and replace all references to the map with its id. Thought might be useful for somefolks here https://gist.github.com/Conaws/647c942ca0c6e0ffd536463f7be6747f

rauh05:06:21

@conaw: I've done something like this (but for datomic -> datascript) just recently.

rauh06:06:03

Though, if your attributes are in the datascript schema, then this is actually done automatically for you in datascript.

rauh06:06:59

So in your example, if you give :c, :that, :deeper a schema, then you can just transact the entire map and it'll all be different entities.

conaw06:06:38

right, and would have to have a schema for those if I wanted to pull them via refs anyway

conaw06:06:16

@rauh: you’re building something datsync’esque?

rauh06:06:27

Nope, just manually synching, the queries are simple enough and transformations are also easy that I don't need more magic for now.