title: SQLite: update a record if exists, otherwise insert it?
body: <p>I tried <code>INSERT OR REPLACE INTO</code>, but it doesn't preserve the row id when it replaces the record to update it. Another option is do it in two steps: <code>INSERT OR IGNORE INTO</code> then <code>UPDATE</code>, but I would prefer a one step solution. So I am wondering if SQLite has something like the <code>MERGE</code> keyword or other simple solutions?</p>