Add the write_lump() function (uses upsert, which SQLite recently added)