datascript

Immutable database and Datalog query engine for Clojure, ClojureScript and JS
Filipe Silva 2020-01-05T15:16:14.018200Z

does anyone know if the order of datoms in a tx matters?

Filipe Silva 2020-01-05T15:17:25.018900Z

I have a bunch of datoms in the operation format (`[:db/add 1 :prop "value]`)

Filipe Silva 2020-01-05T15:18:20.019900Z

if it helps, I know these are already normalised because I got them off a tx-report

Filipe Silva 2020-01-05T15:20:01.021Z

I'd like to know if I could transact them in a new tx but in random order, and if that'd always yield the same db

2020-01-05T19:04:25.023400Z

I suspect the order of :db/add and :db/retract in a transaction will matter if they refer to the same attribute of the same entity

Filipe Silva 2020-01-05T19:27:27.023600Z

yes that sounds likely...

Filipe Silva 2020-01-05T19:28:04.024300Z

I also tried making the order not matter and that make some pulls present varying order on ref arrays

kenny 2020-01-05T19:52:28.025Z

@filipematossilva fwiw, I believe the behavior of datascript & datomic differ in behavior for this case. https://github.com/tonsky/datascript/issues/172

Filipe Silva 2020-01-05T22:07:17.025400Z

that definitely answers my question

Filipe Silva 2020-01-05T22:07:29.025800Z

so yeah, order matters a lot

Filipe Silva 2020-01-05T22:07:30.026Z

thanks!