Error code

SQLite SQLITE_CONSTRAINT_UNIQUE

SQLITESQLITE_CONSTRAINT_UNIQUE
Database Error Code· An error code returned by a database server such as PostgreSQL or MySQL.

What it means

UNIQUE constraint failed — a duplicate value was inserted.

How to fix it

  1. Use INSERT OR REPLACE or INSERT OR IGNORE to handle duplicates gracefully.
  2. Check for existing rows before inserting with a SELECT query.
  3. Review application logic to avoid generating duplicate key values.

Not affiliated with SQLite. Answer summarized from the manufacturer's manual linked above; consult that source for the authoritative procedure.