{"html_url": "https://github.com/simonw/sqlite-utils/issues/98#issuecomment-928790381", "issue_url": "https://api.github.com/repos/simonw/sqlite-utils/issues/98", "id": 928790381, "node_id": "IC_kwDOCGYnMM43XDdt", "user": {"value": 36834097, "label": "patricktrainer"}, "created_at": "2021-09-28T04:38:44Z", "updated_at": "2021-09-28T04:38:44Z", "author_association": "NONE", "body": "Hi @simonw - wondering if you might be able to shed some light here. I've seemed to reproduce this issue. \r\nHere's the stacktrace: \r\n\r\n```\r\n... db[\"potholes\"].insert(pothole, pk='id', alter=True, replace=True)\r\n... \r\n\r\nTraceback (most recent call last):\r\n File \"\", line 3, in \r\n File \"/Users/patricktrainer/.pyenv/versions/3.9.0/lib/python3.9/site-packages/sqlite_utils/db.py\", line 2481, in insert\r\n return self.insert_all(\r\n File \"/Users/patricktrainer/.pyenv/versions/3.9.0/lib/python3.9/site-packages/sqlite_utils/db.py\", line 2596, in insert_all\r\n self.insert_chunk(\r\n File \"/Users/patricktrainer/.pyenv/versions/3.9.0/lib/python3.9/site-packages/sqlite_utils/db.py\", line 2424, in insert_chunk\r\n row = list(self.rows_where(\"rowid = ?\", [self.last_rowid]))[0]\r\nIndexError: list index out of range\r\n```\r\n\r\nInteresting enough, I found that omitting the `pk` param does not throw the error.\r\n\r\nLet me know how I can help out! \r\n\r\n", "reactions": "{\"total_count\": 0, \"+1\": 0, \"-1\": 0, \"laugh\": 0, \"hooray\": 0, \"confused\": 0, \"heart\": 0, \"rocket\": 0, \"eyes\": 0}", "issue": {"value": 597671518, "label": "Only set .last_rowid and .last_pk for single update/inserts, not for .insert_all()/.upsert_all() with multiple records"}, "performed_via_github_app": null}