Fork me on GitHub
#datascript
<
2015-09-28
>
wildermuthn14:09:17

So happy to have found this channel.

wildermuthn14:09:57

I want to use the datom diffs in a transaction report to update datascript running on nodejs. Is that possible to do directly, or do I need to parse the datoms into :db/adds?

wildermuthn14:09:51

[3 :project/title “title” 123456 false] [3 :project/title “new title” 123457 true] into [:db/add 3 :project/title “new title”]

wildermuthn14:09:32

Looks like init-db might be useful, but not sure that’s the right way to go about it.

wildermuthn14:09:23

My goal is to avoid using datomic, and to sync browser clients via datascript on nodejs.

bhagany14:09:56

If you don't have other data in the db than the datoms you're loading, init-db works well

wildermuthn14:09:33

I do have the last sync of the db from the browser. So I’d be merging those new datoms into a pre-existing db.

bhagany14:09:55

as far as I know, you'd have to transact that, then

wildermuthn14:09:11

I don’t want to hack datascript to include the ds query in the metadata for the tx-report, but that seems the cleanest route.

wildermuthn14:09:58

So you think transacting the transformed diffs (parsing them into :db/adds) would be the way to go?

bhagany14:09:12

that would be my first try, yes

wildermuthn14:09:44

Does datascript doesn’t keep the false datoms?

bhagany14:09:04

I know it does some sort of cleaning, to keep memory down, but I don't know the details

wildermuthn14:09:32

I suppose it wouldn’t matter if I’m parsing it into :db/add.

bhagany14:09:03

you'll still need to transact those as :db/removes though, otherwise datascript will think a fact is still valid when it's not