Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Upsert on entity with identity composite tuple #299

Open
fahtative opened this issue Dec 20, 2024 · 1 comment
Open

Upsert on entity with identity composite tuple #299

fahtative opened this issue Dec 20, 2024 · 1 comment
Labels
bug Something isn't working

Comments

@fahtative
Copy link

This is also mentioned on Datascript's Issues.
Basically upsert to update fails on entity with unique composite tuple:

(def schema {:a+b {:db/tupleAttrs [:a :b]
                     :db/unique :db.unique/identity}})
(def conn (dl/get-conn "test-dl" schema))
(dl/transact conn [{:a 1 :b 2}])
(dl/transact conn [{:a 1 :b 2}])
Execution error (ExceptionInfo) at datalevin.db/validate-datom (db.clj:724).
Cannot add #datalevin/Datom [2 :a+b [1 2]] because of unique constraint: [#datalevin/Retrieved [nil 3 [1 2] nil] #datalevin/Retrieved [1 nil nil 0]]
@huahaiy
Copy link
Contributor

huahaiy commented Jan 2, 2025

Will take a look.

@huahaiy huahaiy added the bug Something isn't working label Jan 2, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants