http://en.wikipedia.org/wiki/Upsert
Insert Update stored proc on SQL Server
Is there some clever way to do this in SQLite that I have not thought of?
If you are generally doing updates I would ..
If you are generally doing inserts I would
This way you avoid the select and you are transactionally sound on Sqlite.