datalevin

rschmukler 2025-06-05T15:57:14.996329Z

@huahaiy as a follow up to my issue a few days ago - It seems that storing an error as a value in datalevin is what causes corrupting the entity:

(let [conn (d/create-conn "db.dl")]
    (d/transact!
      conn
      [{:entity-with-error (ex-info "Boom" {})}])
    (d/entity (d/db conn) 1) ;; Looks good
    (d/transact!
      conn
      [[:db/retractEntity 1]])
    (d/entity (d/db conn) 1) ;; Still exists
    (d/touch (d/entity (d/db conn) 1)) ;; Can still return data
    )
Any ideas on how I can work around this beyond migrating the data (minus the entity). Want me to open an issue on GitHub? On further investigation, I found the following: 1. You can still add attributes to the affected entity via :db/add 2. You cannot retract the error attribute via :db/retract 3. You cannot retract the entity via :db/retractEntity (probably because of 2) 4. You can retract other attributes on the entity via :db/retract

Huahai 2025-06-09T01:25:36.138769Z

Sure, open an issue and I will investigate