sqlite has no ON DUPLICATE KEY UPDATE. so testing workaround