changed id to key in sqlite update/insert script