home / github

Menu
  • Search all tables
  • GraphQL API

issue_comments

Table actions
  • GraphQL API for issue_comments

5 rows where issue = 1108671952 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 · 5 ✖

issue 1

  • Scripted exports · 5 ✖

author_association 1

  • OWNER 5
id html_url issue_url node_id user created_at updated_at ▲ author_association body reactions issue performed_via_github_app
1331694246 https://github.com/simonw/datasette/issues/1605#issuecomment-1331694246 https://api.github.com/repos/simonw/datasette/issues/1605 IC_kwDOBm6k_c5PYAqm simonw 9599 2022-11-30T06:18:41Z 2022-11-30T06:18:41Z OWNER

Those sounds to me like they should be promoted to documented, supported internals.

{
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
Scripted exports 1108671952  
1328169472 https://github.com/simonw/datasette/issues/1605#issuecomment-1328169472 https://api.github.com/repos/simonw/datasette/issues/1605 IC_kwDOBm6k_c5PKkIA simonw 9599 2022-11-27T04:32:14Z 2022-11-27T04:32:14Z OWNER

@eyeseast I started work on that plugin: https://github.com/simonw/datasette-export

{
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
Scripted exports 1108671952  
1072907200 https://github.com/simonw/datasette/issues/1605#issuecomment-1072907200 https://api.github.com/repos/simonw/datasette/issues/1605 IC_kwDOBm6k_c4_80PA simonw 9599 2022-03-19T00:52:54Z 2022-03-19T00:53:45Z OWNER

Had a thought about the implementation of this: it could make a really neat plugin.

Something like datasette-export which adds a export command using https://docs.datasette.io/en/stable/plugin_hooks.html#register-commands-cli - then you could run:

datasette export my-export-dir mydatabase.db -m metadata.json --template-dir templates/

And the command would then:

  • Create a Datasette() instance with those databases/metadata/etc
  • Executeawait datasette.client.get("/") to get the homepage HTML
  • Parse the HTML using BeautifulSoup to find all a[href], link[href], script[src], img[src] elements that reference a relative path as opposed to one that starts with http://
  • Write out the homepage to my-export-dir/index.html
  • Recursively fetch and dump all of the other pages and assets that it found too

All of that HTML parsing may be over-complicating things. It could alternatively accept options for which pages you want to export:

datasette export my-export-dir \ mydatabase.db -m metadata.json --template-dir templates/ \ --path / \ --path /mydatabase ...

Or a really wild option: it could allow you to define the paths you want to export using a SQL query:

datasette export my-export-dir \ mydatabase.db -m metadata.json --template-dir templates/ \ --sql " select '/' as path, 'index.html' as filename union all select '/mydatabase/articles/' || id as path, 'article-' || id || '.html' as filename from articles union all select '/mydatabase/tags/' || tag as path, 'tag-' || tag || '.html' as filename from tags " Which would save these files: - index.html as the content of / - article-1.html (and more) as the content of /mydatabase/articles/1 - tag-python.html (and more) as the content of /mydatabase/tags/python

{
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
Scripted exports 1108671952  
1018766727 https://github.com/simonw/datasette/issues/1605#issuecomment-1018766727 https://api.github.com/repos/simonw/datasette/issues/1605 IC_kwDOBm6k_c48uSWH simonw 9599 2022-01-21T18:41:21Z 2022-01-21T18:42:03Z OWNER

Yeah I think this all hinges on: - #1101

Also this comment about streaming full JSON arrays (not just newline-delimited) using this trick: - https://github.com/simonw/datasette/issues/1356#issuecomment-1017016553

I'm about ready to figure these out, as with so much it's still a little bit blocked on the refactor stuff from: - #1518

{
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
Scripted exports 1108671952  
1016977725 https://github.com/simonw/datasette/issues/1605#issuecomment-1016977725 https://api.github.com/repos/simonw/datasette/issues/1605 IC_kwDOBm6k_c48ndk9 simonw 9599 2022-01-19T23:55:08Z 2022-01-19T23:55:08Z OWNER

Oh that's interesting. I was thinking about this from a slightly different angle recently - pondering what a static site generator built on top of Datasette might look like.

Just a sketch at the moment, but I was imagining a YAML configuration file with a SQL query that returns a list of paths - then a tool that runs that query and uses the equivalent of datasette --get to create a static copy of each of those paths.

I think these two ideas can probably be merged. I'd love to know more about how you are solving this right now!

{
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
Scripted exports 1108671952  

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