ribelo / doxa

The Unlicense
232 stars 8 forks source link

:dx/merge switches cardinality of single refs #35

Closed stevebuik closed 2 years ago

stevebuik commented 2 years ago
(let [data [{:id   "10"
             :name "Enzo"
             :car  {:id    11
                    :model "Testarossa"}}]
      db1 (->> data
               (vector :dx/merge)
               (dx/commit (dx/create-dx)))
      db2 (->> data
               (vector :dx/merge)
               (dx/commit db1))]
  {:good (:car (dx/pull db1 [:name {:car [:id :model]}] [:id "10"]))
   :bad  (:car (dx/pull db2 [:name {:car [:id :model]}] [:id "10"]))})
stevebuik commented 2 years ago

bad because result is now a vector. value in db was converted to set by 2nd commit

no easy workaround for this one unfortunately

stevebuik commented 2 years ago

fix confirmed in Hotplate