home / github / issue_comments

Menu
  • GraphQL API

issue_comments: 1557607516

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/554#issuecomment-1557607516 https://api.github.com/repos/simonw/sqlite-utils/issues/554 1557607516 IC_kwDOCGYnMM5c1zRc 1231935 2023-05-22T17:18:33Z 2023-05-22T17:18:33Z NONE Oh and for context - this goes away if I use `.upsert` instead of `insert(..., ignore=True)`, but I don't want to update the value if it's written, just do an insert if it's new. The code is basically: ```py def save_items(table, items): db["users"].insert(build_user(items[0]), pk="id",ignore=True) db[table].insert_all(items) if comments := fetch_comments(): save_items('comments', comments) if posts := fetch_posts(): save_items('posts', posts) ``` So either `comments` or `post` could create the relevant user if those items exist. In cases where they _both_ exist, I get this error. I need the `pk` because either call could create the table. {"total_count": 0, "+1": 0, "-1": 0, "laugh": 0, "hooray": 0, "confused": 0, "heart": 0, "rocket": 0, "eyes": 0} 1720096994  
Powered by Datasette · Queries took 0.919ms