property ApplyChangesetOptions.onConflict
A function that determines how to handle conflicts. The function receives one argument, which can be one of the following values:
SQLITE_CHANGESET_DATA: ADELETEorUPDATEchange does not contain the expected "before" values.SQLITE_CHANGESET_NOTFOUND: A row matching the primary key of theDELETEorUPDATEchange does not exist.SQLITE_CHANGESET_CONFLICT: AnINSERTchange results in a duplicate primary key.SQLITE_CHANGESET_FOREIGN_KEY: Applying a change would result in a foreign key violation.SQLITE_CHANGESET_CONSTRAINT: Applying a change results in aUNIQUE,CHECK, orNOT NULLconstraint violation.
The function should return one of the following values:
SQLITE_CHANGESET_OMIT: Omit conflicting changes.SQLITE_CHANGESET_REPLACE: Replace existing values with conflicting changes (only valid withSQLITE_CHANGESET_DATAorSQLITE_CHANGESET_CONFLICTconflicts).SQLITE_CHANGESET_ABORT: Abort on conflict and roll back the database.
When an error is thrown in the conflict handler or when any other value is returned from the handler, applying the changeset is aborted and the database is rolled back.
Default: A function that returns SQLITE_CHANGESET_ABORT.
Type #
((conflictType: number) => number) | undefined