db.insert(targetTable).values(targetValues).onConflict((conflictObject) => {
if(conflictObject.field === “id”){
conflictObject.update({ target: targetTable.id, set: targetValues })
}
if(conflictObject.field === “anotherUniqueField” {
// write to file here
console.log("this entry was skipped do to a conflict on the field: "anotherUniqueField", targetValues);
// do nothing
return;
}
if(conflictObject.field === “fieldWForeignConstraint” {
// write to file here
console.log("this entry was skipped do to a conflict on the field: “fieldWForeignCosntraint”", targetValues);
// do nothing
return;
}
})
db.insert(targetTable).values(targetValues).onConflict((conflictObject) => {
if(conflictObject.field === “id”){
conflictObject.update({ target: targetTable.id, set: targetValues })
}
if(conflictObject.field === “anotherUniqueField” {
// write to file here
console.log("this entry was skipped do to a conflict on the field: "anotherUniqueField", targetValues);
// do nothing
return;
}
if(conflictObject.field === “fieldWForeignConstraint” {
// write to file here
console.log("this entry was skipped do to a conflict on the field: “fieldWForeignCosntraint”", targetValues);
// do nothing
return;
}
})