Re:SQLite: Small, Fast, Reliable – Choose any three
by kennywinker on Tuesday July 15, 2014 @02:51AM
(#8035134)
Just today I encountered an "insert or update" situation and handled it like this:
I'm not familiar with "upsert" so maybe there is a difference, but this worked well for my use case (which was "increment or insert then increment"). You could even reverse the operations (by adding OR IGNORE to the UPDATE statement), if you wanted to not do two operations if the pk didn't exist yet.
[ Parent
| on HN ]
There are no comments on this comment yet.