HF RL Explorer

Task: Implement SQLite UPSERT (UPDATE OR INSERT) Without Changing Primary Key IDs

Task: Implement SQLite UPSERT (UPDATE OR INSERT) Without Changing Primary Key IDs: a task in Terminal-Lego-15k (Harbor dataset). Implement an UPSERT operation in SQLite that inserts a new row if it doesn't exist, or updates the existing row if it does — without deleting and recreating the row…

The task

Implement an UPSERT operation in SQLite that inserts a new row if it doesn't exist, or updates the existing row if it does — **without deleting and recreating the row** (i.e., preserving the original `id` primary key value). This is important when foreign keys reference the `id` column.

Part of PrimeIntellect/Terminal-Lego-15k.