issues: 1083927147
This data as json
id | node_id | number | title | user | state | locked | assignee | milestone | comments | created_at | updated_at | closed_at | author_association | pull_request | body | repo | type | active_lock_reason | performed_via_github_app | reactions | draft | state_reason |
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
1083927147 | I_kwDOBm6k_c5Am2pr | 1571 | Track number of executions for execute_write_many() in traces | 9599 | closed | 0 | 7571612 | 0 | 2021-12-18T19:16:17Z | 2022-01-13T22:27:49Z | 2021-12-19T20:30:40Z | OWNER | Spotted while working on #1555 <img width="1171" alt="image" src="https://user-images.githubusercontent.com/9599/146653166-ce5358bc-b822-4961-a2dd-ed3efaa8dd13.png"> There's no indication there of how many times `execute_write_many()` executed the SQL. Solving this is a tiny bit tricky because `params_seq` is an iterator that we don't want to exhaust before passing it to `conn.executemany()` - so we need to instead wrap it in something that counts how many times it was called. But then we need a way to attach that to the trace here: https://github.com/simonw/datasette/blob/d637ed46762fdbbd8e32b86f258cd9a53c1cfdc7/datasette/database.py#L115-L122 So probably need to redesign the `trace()` decorator to allow extra pairs to be attached to it within the `with` statement. | 107914493 | issue | {"url": "https://api.github.com/repos/simonw/datasette/issues/1571/reactions", "total_count": 0, "+1": 0, "-1": 0, "laugh": 0, "hooray": 0, "confused": 0, "heart": 0, "rocket": 0, "eyes": 0} | completed |