asami

Jakub Holý (HolyJak) 2023-04-29T20:23:51.542629Z

Hello! If I have an owned entity, and remove the link between it and the owner entity, I would want the whole owned entity retracted. Is this possible? And how do I even retract the linking property? I have tried this

(do
    (d/delete-database "asami:")
    (d/create-database "asami:")
    (def conn (d/connect "asami:"))
    @(d/transact conn {:tx-data
                       [{:id :parent/one,
                         :parent/name "Father"
                         :parent/child {:id :child/first, :child/name "Kiddy"}}]}))
@(d/transact conn {:tx-data [{:id :parent/one, :parent/child' #{}}]})
But the final transact fails with an error (as it does if I pass in nil . Transacting [:db/retract :parent/one :parent/child :child/first] works but I would need to go in and manually retract each of the child’s attributes. Is that the only way? Thank you!