fox for scope_identity for sqlite, and fix a little bug causing just-inserted records to not register for subsequent updates