home / github

Menu
  • Search all tables
  • GraphQL API

issue_comments

Table actions
  • GraphQL API for issue_comments

5 rows where user = 1231935 sorted by updated_at descending

✖
✖

✎ View and edit SQL

This data as json, CSV (advanced)

Suggested facets: created_at (date), updated_at (date)

issue 5

  • devrel/python api: Pylance type hinting 1
  • Suggestion: Hiding columns 1
  • Add permalink virtual field to items table 1
  • `table.upsert_all` fails to write rows when `not_null` is present 1
  • `IndexError` when doing `.insert(..., pk='id')` after `insert_all` 1

user 1

  • xavdid · 5 ✖

author_association 1

  • NONE 5
id html_url issue_url node_id user created_at updated_at ▲ author_association body reactions issue performed_via_github_app
1557607516 https://github.com/simonw/sqlite-utils/issues/554#issuecomment-1557607516 https://api.github.com/repos/simonw/sqlite-utils/issues/554 IC_kwDOCGYnMM5c1zRc xavdid 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
}
`IndexError` when doing `.insert(..., pk='id')` after `insert_all` 1720096994  
1538975545 https://github.com/simonw/sqlite-utils/issues/538#issuecomment-1538975545 https://api.github.com/repos/simonw/sqlite-utils/issues/538 IC_kwDOCGYnMM5buuc5 xavdid 1231935 2023-05-08T20:06:35Z 2023-05-08T20:06:35Z NONE

perfect, thank you!

{
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
`table.upsert_all` fails to write rows when `not_null` is present 1695428235  
1532481862 https://github.com/simonw/sqlite-utils/issues/496#issuecomment-1532481862 https://api.github.com/repos/simonw/sqlite-utils/issues/496 IC_kwDOCGYnMM5bV9FG xavdid 1231935 2023-05-03T05:53:26Z 2023-05-03T05:53:26Z NONE

Would love to put our heads together for improvements here.

I think anything that is argname=DEFAULT needs to be typed as argname: str | Default = DEFAULT (replacing str with the appropriate type(s)). We may be able to get clever and tie the types to that key in the _defaults dict (definitely possible in Typescript, but I'm less familiar with advanced python types).

Right now, all args are typed as Default, which means all callers get type errors.

As for table/view, given that they don't have the same methods, it would be nice to be able to get one or the other specifically.

{
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
devrel/python api: Pylance type hinting 1393202060  
1491357104 https://github.com/simonw/datasette/issues/1989#issuecomment-1491357104 https://api.github.com/repos/simonw/datasette/issues/1989 IC_kwDOBm6k_c5Y5E2w xavdid 1231935 2023-03-31T06:17:23Z 2023-03-31T06:18:05Z NONE

I'm running into a similar use case as pax above- I made a nice view that just has the data I'm interested in (which doesn't include the id, since it's not important in this case). But, by excluding id from the view, I can't do fts queries against it because the view has no id field to tie to rowid:

ERROR: conn=<sqlite3.Connection object at 0x106521210>, sql = 'select time, text, permalink, num_children from nice where id in (select rowid from items_fts where items_fts match :search) limit 101', params = {'search': 'whatever'}: no such column: id

It works fine when I include id in my view, but now my nice view is cluttered up. Would be great to hide it permanently in the config.json.

{
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
Suggestion: Hiding columns 1531991339  
1489110168 https://github.com/dogsheep/hacker-news-to-sqlite/pull/6#issuecomment-1489110168 https://api.github.com/repos/dogsheep/hacker-news-to-sqlite/issues/6 IC_kwDODtX3eM5YwgSY xavdid 1231935 2023-03-29T18:36:16Z 2023-03-29T18:36:16Z NONE

@simonw can you take a look when you have a chance?

{
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
Add permalink virtual field to items table 1641117021  

Advanced export

JSON shape: default, array, newline-delimited, object

CSV options:

CREATE TABLE [issue_comments] (
   [html_url] TEXT,
   [issue_url] TEXT,
   [id] INTEGER PRIMARY KEY,
   [node_id] TEXT,
   [user] INTEGER REFERENCES [users]([id]),
   [created_at] TEXT,
   [updated_at] TEXT,
   [author_association] TEXT,
   [body] TEXT,
   [reactions] TEXT,
   [issue] INTEGER REFERENCES [issues]([id])
, [performed_via_github_app] TEXT);
CREATE INDEX [idx_issue_comments_issue]
                ON [issue_comments] ([issue]);
CREATE INDEX [idx_issue_comments_user]
                ON [issue_comments] ([user]);
Powered by Datasette · Queries took 47.242ms · About: github-to-sqlite
  • Sort ascending
  • Sort descending
  • Facet by this
  • Hide this column
  • Show all columns
  • Show not-blank rows