home / github

Menu
  • Search all tables
  • GraphQL API

issue_comments

Table actions
  • GraphQL API for issue_comments

4 rows where author_association = "OWNER", issue = 665700495 and "updated_at" is on date 2020-07-27 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 4

issue 1

  • CLI utility for inserting binary files into SQLite · 4 ✖

author_association 1

  • OWNER · 4 ✖
id html_url issue_url node_id user created_at updated_at ▲ author_association body reactions issue performed_via_github_app
664163524 https://github.com/simonw/sqlite-utils/issues/122#issuecomment-664163524 https://api.github.com/repos/simonw/sqlite-utils/issues/122 MDEyOklzc3VlQ29tbWVudDY2NDE2MzUyNA== simonw 9599 2020-07-27T07:10:41Z 2020-07-27T07:10:41Z OWNER

Docs: https://github.com/simonw/sqlite-utils/blob/ebc802f7ff0e640b6ae11ea525290fea0115228c/docs/cli.rst#inserting-binary-data-from-files

{
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
CLI utility for inserting binary files into SQLite 665700495  
664128071 https://github.com/simonw/sqlite-utils/issues/122#issuecomment-664128071 https://api.github.com/repos/simonw/sqlite-utils/issues/122 MDEyOklzc3VlQ29tbWVudDY2NDEyODA3MQ== simonw 9599 2020-07-27T05:30:54Z 2020-07-27T05:30:54Z OWNER

Inserting files by piping them in should work - but since a filename cannot be derived this will need a --name blah.gif option.

cat blah.gif | sqlite-utils insert-files files.db files - --name=blah.gif
{
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
CLI utility for inserting binary files into SQLite 665700495  
664127741 https://github.com/simonw/sqlite-utils/issues/122#issuecomment-664127741 https://api.github.com/repos/simonw/sqlite-utils/issues/122 MDEyOklzc3VlQ29tbWVudDY2NDEyNzc0MQ== simonw 9599 2020-07-27T05:29:48Z 2020-07-27T05:29:48Z OWNER

Test command: sqlite-utils insert-files gifs.db *.gif \ -c filename:filename \ -c filepath:filepath \ -c absolutepath:absolutepath \ -c sha256:sha256 \ -c md5:md5 \ -c content:content \ -c mtime:mtime \ -c ctime:ctime \ -c mtime_iso:mtime_iso \ -c ctime_iso:ctime_iso \ -c size:size \ --pk absolutepath

{
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
CLI utility for inserting binary files into SQLite 665700495  
663931279 https://github.com/simonw/sqlite-utils/issues/122#issuecomment-663931279 https://api.github.com/repos/simonw/sqlite-utils/issues/122 MDEyOklzc3VlQ29tbWVudDY2MzkzMTI3OQ== simonw 9599 2020-07-26T03:33:23Z 2020-07-27T04:30:49Z OWNER

One idea: sqlite-utils insert-files

It could work something like this:

sqlite-utils insert-files files.db /tmp/blah.jpg /tmp/foo.gif \
  --table files \
  -c key:filename -c hash:sha256 -c body:content \
  --pk key

This would insert those two image files into the database in a table called files with a schema that looks something like this:

sql CREATE TABLE files ( key text primary key, hash text, body blob );

The -c key:filename options here are the most interesting: they let you create the table with a specific layout. The bit before the : is the column name. The bit after the : can be a range of different things:

  • filename - just the filename
  • filepath - the full filepath (provided on the command-line)
  • absolutepath - the filepath expanded to start with /home/... or whatever
  • sha256 - the SHA256 of the contents
  • md5 - the MD5
  • content - the binary content itself
  • mtime - the mtime (floating point timestamp)
  • ctime - the ctime (floating point timestamp)
  • mtime_iso - the mtime as an ISO datetime
  • ctime_iso - the mtime as an ISO datetime
  • size - the size of the file in bytes
{
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
CLI utility for inserting binary files into SQLite 665700495  

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 15.313ms · About: github-to-sqlite