Skip to content

store-insert-requires-on-conflict

Review conflict handling for embedded inserts in replay-named callables.

Why

Names such as seed, enqueue, or upsert suggest that repeated execution deserves a conflict-policy review, but do not prove a replay contract.

Fix

Choose conflict handling appropriate to the schema and SQL dialect, or document why this insertion must fail on a duplicate.

Examples

Before — flagged Review a bare insert in a replay-named callable
src/store.ts
function seed() {
db.prepare(`INSERT INTO runs (id) VALUES (?)`).run();
}
After — preferred Review the conflict policy for a replayed insert
src/store.ts
function seed() {
db.prepare(`INSERT INTO runs (id) VALUES (?) ON CONFLICT(id) DO NOTHING`).run();
}