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
I am trying to do an upsert operation on a SQLite table with a UNIQUE constraint involving the fields slug and organization_id. However, when a row with the slug and the organization_id already exist, instead of updating the records, a UNIQUE constraint violation error is thrown. I am using turso!
I expected the existing record to be updated with the new values provided in the payload.
Actual Result:
The process fails with a UNIQUE constraint error, indicating it cannot insert a record due to the violation of the uniqueness constraint on categories.slug and categories.organization_id.
What version of
drizzle-orm
are you using?0.29.5
What version of
drizzle-kit
are you using?0.20.18
Description
I am trying to do an upsert operation on a SQLite table with a UNIQUE constraint involving the fields slug and organization_id. However, when a row with the slug and the organization_id already exist, instead of updating the records, a UNIQUE constraint violation error is thrown. I am using turso!
Steps to Reproduce:
1. Table definition in SQLite:
2. Attempted upsert function:
3. Error received when executing the function where slug and organization_id already exist:
Expected behavior
I expected the existing record to be updated with the new values provided in the payload.
Actual Result:
The process fails with a UNIQUE constraint error, indicating it cannot insert a record due to the violation of the uniqueness constraint on categories.slug and categories.organization_id.
Environment & setup:
Node.js:
18.18.2
drizzle-orm:
0.29.5
drizzle-kit:
0.20.18
The text was updated successfully, but these errors were encountered: