issue_comments: 862494864
This data as json
html_url | issue_url | id | node_id | user | created_at | updated_at | author_association | body | reactions | issue | performed_via_github_app |
---|---|---|---|---|---|---|---|---|---|---|---|
https://github.com/simonw/sqlite-utils/issues/267#issuecomment-862494864 | https://api.github.com/repos/simonw/sqlite-utils/issues/267 | 862494864 | MDEyOklzc3VlQ29tbWVudDg2MjQ5NDg2NA== | 9599 | 2021-06-16T15:51:28Z | 2021-06-16T16:26:15Z | OWNER | I did add a slightly clumsy mechanism recently to help a bit here though: the `pks_and_rows_where()` method: https://sqlite-utils.datasette.io/en/stable/python-api.html#listing-rows-with-their-primary-keys More details in the issue for that feature: #240 The idea here is that if you want to call update you need the primary key for the row - so you can do this: ```python for pk, row in db["sometable"].pks_and_rows_where(): db["sometable"].update(pk, {"modified": 1}") ``` The `pk` may end up as a single value or a tuple depending on if the table has a compound primary key - but you don't need to worry about that if you use this method as it will return the correct primary key value for you. | {"total_count": 0, "+1": 0, "-1": 0, "laugh": 0, "hooray": 0, "confused": 0, "heart": 0, "rocket": 0, "eyes": 0} | 915421499 |