Error code

SQLite SQLITE_CONSTRAINT

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

What it means

a constraint violation was raised — the write violates a database rule.

How to fix it

  1. Inspect the extended error code with sqlite3_extended_errcode to identify which constraint was violated.
  2. Validate data in application code before writing and use ON CONFLICT clauses (REPLACE or IGNORE) for expected conflicts.
  3. Check the schema with PRAGMA table_info(<table>) to see all constraints.

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