You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
entity.SomeFIeld has unique index index defined. So on insert of entities with the same value of SomeFIeld, i'd expect UNIQUE constraint failed to be raised.
However, for upserts, i'd like the other columns to be overriden with the new values.
While using below code to achieve bulk insert while allowing upserts, i'm getting UNIQUE constraint failed.
Doing insert one by one doesn't result in this error:
for _, test := range `entitiesData`{
_, err := dal.db.entities.
Create().
SetField1(test.some)
OnConflictColumns((entity.SomeFIeld).
UpdateNewValues().ID(ctx)
}
The issue is present in the latest release.
I have searched the issues of this repository and believe that this is not a duplicate.
Current Behavior 😯
UNIQUE constraint failed raised
Expected Behavior 🤔
no UNIQUE constraint failed raised
Your Environment 🌎
Tech
Version
Go
go1.21.7
Ent
v0.12.5
Database
Posgres
The text was updated successfully, but these errors were encountered:
entity.SomeFIeld
hasunique index
index defined. So on insert of entities with the same value ofSomeFIeld
, i'd expectUNIQUE constraint failed
to be raised.However, for upserts, i'd like the other columns to be overriden with the new values.
While using below code to achieve bulk insert while allowing upserts, i'm getting
UNIQUE constraint failed
.Doing insert one by one doesn't result in this error:
Current Behavior 😯
UNIQUE constraint failed
raisedExpected Behavior 🤔
no
UNIQUE constraint failed
raisedYour Environment 🌎
The text was updated successfully, but these errors were encountered: