-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Replace SELECT + REPLACE INTO with one INSERT with an UPSERT clause
This really shows you that fresh eyes are important! I thought I checked my triggers yesterday, but today, I had the idea to run the setup SQL in the `sqlite3` REPL and remove various parts until it worked. It turns out one of my triggers was broken, but I didn't catch it earlier because REPLACE INTO deletes and re-creates the entire row instead of updating it. The "4 values for 5 columns" error was indeed the problem, I just didn't look closely enough.
- Loading branch information
1 parent
6e9c4a9
commit 8c8ce27
Showing
2 changed files
with
7 additions
and
23 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters