home / github

Menu
  • Search all tables
  • GraphQL API

issue_comments

Table actions
  • GraphQL API for issue_comments

3 rows where issue = 593751293 and user = 9599 sorted by updated_at descending

✖
✖
✖

✎ View and edit SQL

This data as json, CSV (advanced)

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

user 1

  • simonw · 3 ✖

issue 1

  • Adding a "recreate" flag to the `Database` constructor · 3 ✖

author_association 1

  • OWNER 3
id html_url issue_url node_id user created_at updated_at ▲ author_association body reactions issue performed_via_github_app
612738311 https://github.com/simonw/sqlite-utils/issues/97#issuecomment-612738311 https://api.github.com/repos/simonw/sqlite-utils/issues/97 MDEyOklzc3VlQ29tbWVudDYxMjczODMxMQ== simonw 9599 2020-04-13T03:55:11Z 2020-04-13T03:55:11Z OWNER

Shipped in 2.5 - documentation is here: https://sqlite-utils.readthedocs.io/en/stable/python-api.html#connecting-to-or-creating-a-database

{
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
Adding a "recreate" flag to the `Database` constructor 593751293  
612732453 https://github.com/simonw/sqlite-utils/issues/97#issuecomment-612732453 https://api.github.com/repos/simonw/sqlite-utils/issues/97 MDEyOklzc3VlQ29tbWVudDYxMjczMjQ1Mw== simonw 9599 2020-04-13T03:26:46Z 2020-04-13T03:26:46Z OWNER

I wonder if it should delete an recreate the file or if it would be safer to drop every table instead?

Dropping tables gets messy: then you need to drop triggers and views, and you need to run vacuum to clean up the space.

My worry with deleting and recreating the file is that it could trigger errors in other processes that are currently attached to that database file. But... if you know that's going to be likely, maybe you shouldn't use the recreate=True feature?

{
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
Adding a "recreate" flag to the `Database` constructor 593751293  
612732129 https://github.com/simonw/sqlite-utils/issues/97#issuecomment-612732129 https://api.github.com/repos/simonw/sqlite-utils/issues/97 MDEyOklzc3VlQ29tbWVudDYxMjczMjEyOQ== simonw 9599 2020-04-13T03:25:29Z 2020-04-13T03:25:29Z OWNER

Interesting thought. I've run into this myself a lot - many of my scripts intend to create the database from scratch, so I end up running !rm /tmp/blah.db in Jupyter and occasionally getting errors if the file doesn't exist.

I think adding recreate=True could make sense. It could throw an error if you attempt to use it after passing in something other than a path to a file on disk.

{
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
Adding a "recreate" flag to the `Database` constructor 593751293  

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 444.095ms · About: github-to-sqlite
  • Sort ascending
  • Sort descending
  • Facet by this
  • Hide this column
  • Show all columns
  • Show not-blank rows