In progressINSERT throws UNIQUE constraint failed / SQLITE_CONSTRAINTA write to a table with a UNIQUE column or index (often the primary business key, like user_id or email) fails with D1_ERROR: UNIQUE constraint failed.
View the whole map (7 more steps)
Confirm a row with that value already exists
Treat the duplicate as an update, or ignore it deliberately
Check whether this is a check-then-insert race
Stop pre-checking; let the constraint be the source of truth
A write to a table with a UNIQUE column or index (often the primary business key, like user_id or email) fails with D1_ERROR: UNIQUE constraint failed.