home / github

Menu
  • Search all tables
  • GraphQL API

issue_comments

Table actions
  • GraphQL API for issue_comments

20 rows where issue = 1174306154 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 20

issue 1

  • Introduce concept of a database `route`, separate from its name · 20 ✖

author_association 1

  • OWNER 20
id html_url issue_url node_id user created_at updated_at ▲ author_association body reactions issue performed_via_github_app
1073136896 https://github.com/simonw/datasette/issues/1668#issuecomment-1073136896 https://api.github.com/repos/simonw/datasette/issues/1668 IC_kwDOBm6k_c4_9sUA simonw 9599 2022-03-20T00:33:23Z 2022-03-20T00:33:23Z OWNER

I'm going to release this as a 0.61 alpha so I can more easily depend on it from datasette-hashed-urls.

{
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
Introduce concept of a database `route`, separate from its name 1174306154  
1073136686 https://github.com/simonw/datasette/issues/1668#issuecomment-1073136686 https://api.github.com/repos/simonw/datasette/issues/1668 IC_kwDOBm6k_c4_9sQu simonw 9599 2022-03-20T00:31:13Z 2022-03-20T00:31:13Z OWNER

That demo is now live:

  • https://latest.datasette.io/alternative-route
  • https://latest.datasette.io/alternative-route/attraction_characteristic
{
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
Introduce concept of a database `route`, separate from its name 1174306154  
1073135433 https://github.com/simonw/datasette/issues/1668#issuecomment-1073135433 https://api.github.com/repos/simonw/datasette/issues/1668 IC_kwDOBm6k_c4_9r9J simonw 9599 2022-03-20T00:20:36Z 2022-03-20T00:20:36Z OWNER

Building this plugin instantly revealed that all of the links - on the homepage and the database page and so on - are incorrect: ```python from datasette import hookimpl

@hookimpl def startup(datasette): db = datasette.get_database("fixtures2") db.route = "alternative-route" ```

{
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
Introduce concept of a database `route`, separate from its name 1174306154  
1073134816 https://github.com/simonw/datasette/issues/1668#issuecomment-1073134816 https://api.github.com/repos/simonw/datasette/issues/1668 IC_kwDOBm6k_c4_9rzg simonw 9599 2022-03-20T00:16:22Z 2022-03-20T00:16:22Z OWNER

I'm going to add a fixtures2.db database which has that as the name but alternative-route as the route. I'll set that up using a custom plugin in the plugins/ folder that gets deployed by https://github.com/simonw/datasette/blob/main/.github/workflows/deploy-latest.yml

{
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
Introduce concept of a database `route`, separate from its name 1174306154  
1073134206 https://github.com/simonw/datasette/issues/1668#issuecomment-1073134206 https://api.github.com/repos/simonw/datasette/issues/1668 IC_kwDOBm6k_c4_9rp- simonw 9599 2022-03-20T00:12:03Z 2022-03-20T00:12:03Z OWNER

I'd like to have a live demo of this up on latest.datasette.io too.

{
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
Introduce concept of a database `route`, separate from its name 1174306154  
1073126264 https://github.com/simonw/datasette/issues/1668#issuecomment-1073126264 https://api.github.com/repos/simonw/datasette/issues/1668 IC_kwDOBm6k_c4_9pt4 simonw 9599 2022-03-19T22:59:30Z 2022-03-19T22:59:30Z OWNER

Also need to update the datasette.urls methods that construct the URL to a database/table/row - they take the database name but they need to know to look for the route.

Need to add tests that check the links in the HTML and can confirm this is working correctly.

{
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
Introduce concept of a database `route`, separate from its name 1174306154  
1073125334 https://github.com/simonw/datasette/issues/1668#issuecomment-1073125334 https://api.github.com/repos/simonw/datasette/issues/1668 IC_kwDOBm6k_c4_9pfW simonw 9599 2022-03-19T22:53:55Z 2022-03-19T22:53:55Z OWNER

Need to update documentation in a few places - e.g. https://docs.datasette.io/en/stable/internals.html#remove-database-name

This removes a database that has been previously added. name= is the unique name of that database, used in its URL path.

{
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
Introduce concept of a database `route`, separate from its name 1174306154  
1073112104 https://github.com/simonw/datasette/issues/1668#issuecomment-1073112104 https://api.github.com/repos/simonw/datasette/issues/1668 IC_kwDOBm6k_c4_9mQo simonw 9599 2022-03-19T21:08:21Z 2022-03-19T21:08:21Z OWNER

I think I've got this working but I need to write a test for it that covers the rare case when the route is not the same thing as the database name.

I'll do that with a new test.

{
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
Introduce concept of a database `route`, separate from its name 1174306154  
1073097394 https://github.com/simonw/datasette/issues/1668#issuecomment-1073097394 https://api.github.com/repos/simonw/datasette/issues/1668 IC_kwDOBm6k_c4_9iqy simonw 9599 2022-03-19T20:56:35Z 2022-03-19T20:56:35Z OWNER

I'm trying to think if there's any reason not to use route for this. Would I possibly want to use that noun for something else in the future? I like it more than route_path because it has no underscore.

Decision made: I'm going with route.

{
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
Introduce concept of a database `route`, separate from its name 1174306154  
1073076187 https://github.com/simonw/datasette/issues/1668#issuecomment-1073076187 https://api.github.com/repos/simonw/datasette/issues/1668 IC_kwDOBm6k_c4_9dfb simonw 9599 2022-03-19T20:28:20Z 2022-03-19T20:28:20Z OWNER

I'm going to keep path as the path to the file on disk. I'll pick a new name for what is currently path in that undocumented JSON API.

{
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
Introduce concept of a database `route`, separate from its name 1174306154  
1073076136 https://github.com/simonw/datasette/issues/1668#issuecomment-1073076136 https://api.github.com/repos/simonw/datasette/issues/1668 IC_kwDOBm6k_c4_9deo simonw 9599 2022-03-19T20:27:44Z 2022-03-19T20:27:44Z OWNER

Pretty sure changing it will break some existing plugins though, including likely Datasette Desktop.

{
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
Introduce concept of a database `route`, separate from its name 1174306154  
1073076110 https://github.com/simonw/datasette/issues/1668#issuecomment-1073076110 https://api.github.com/repos/simonw/datasette/issues/1668 IC_kwDOBm6k_c4_9deO simonw 9599 2022-03-19T20:27:22Z 2022-03-19T20:27:22Z OWNER

The docs do currently describe path as the filesystem path here: https://docs.datasette.io/en/stable/internals.html#database-class

Good thing I'm not at 1.0 yet so I can change that!

{
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
Introduce concept of a database `route`, separate from its name 1174306154  
1073076015 https://github.com/simonw/datasette/issues/1668#issuecomment-1073076015 https://api.github.com/repos/simonw/datasette/issues/1668 IC_kwDOBm6k_c4_9dcv simonw 9599 2022-03-19T20:26:32Z 2022-03-19T20:26:32Z OWNER

I'm inclined to redefine ds.path to ds.file_path to fix this. Or ds.filepath.

{
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
Introduce concept of a database `route`, separate from its name 1174306154  
1073075913 https://github.com/simonw/datasette/issues/1668#issuecomment-1073075913 https://api.github.com/repos/simonw/datasette/issues/1668 IC_kwDOBm6k_c4_9dbJ simonw 9599 2022-03-19T20:25:46Z 2022-03-19T20:26:08Z OWNER

The output of /.json DOES use path to mean the URL path, not the path to the file on disk:

{ "fixtures.dot": { "name": "fixtures.dot", "hash": null, "color": "631f11", "path": "/fixtures~2Edot", So that's a problem already: having db.path refer to something different from that JSON is inconsistent.

{
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
Introduce concept of a database `route`, separate from its name 1174306154  
1073075697 https://github.com/simonw/datasette/issues/1668#issuecomment-1073075697 https://api.github.com/repos/simonw/datasette/issues/1668 IC_kwDOBm6k_c4_9dXx simonw 9599 2022-03-19T20:24:06Z 2022-03-19T20:24:06Z OWNER

Right now if a database has a . in its name e.g. fixtures.dot the URL to that database is:

/fixtures~2Edot

But the output on /-/databases doesn't reflect that, it still shows the name with the dot.

{
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
Introduce concept of a database `route`, separate from its name 1174306154  
1073073579 https://github.com/simonw/datasette/issues/1668#issuecomment-1073073579 https://api.github.com/repos/simonw/datasette/issues/1668 IC_kwDOBm6k_c4_9c2r simonw 9599 2022-03-19T20:06:27Z 2022-03-19T20:06:27Z OWNER

Marking this as blocked until #1660 is done.

{
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
Introduce concept of a database `route`, separate from its name 1174306154  
1073073547 https://github.com/simonw/datasette/issues/1668#issuecomment-1073073547 https://api.github.com/repos/simonw/datasette/issues/1668 IC_kwDOBm6k_c4_9c2L simonw 9599 2022-03-19T20:06:07Z 2022-03-19T20:06:07Z OWNER

Implementing this is a little tricky because there's a whole lot of code that expects the database captured by the URL routing to be the name used to look up the database in datasette.databases - or via .get_database().

The DataView.get() method is a good example of the trickyness here. It even has code that dispatches out to plugin hooks that take database as a parameter.

https://github.com/simonw/datasette/blob/61419388c134001118aaf7dfb913562d467d7913/datasette/views/base.py#L383-L555

All the more reason to get rid of that BaseView -> DataView -> TableView hierarchy entirely: - #1660

{
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
Introduce concept of a database `route`, separate from its name 1174306154  
1073043433 https://github.com/simonw/datasette/issues/1668#issuecomment-1073043433 https://api.github.com/repos/simonw/datasette/issues/1668 IC_kwDOBm6k_c4_9Vfp simonw 9599 2022-03-19T16:54:55Z 2022-03-19T20:01:19Z OWNER

Options: - route_path - url_path - route

I like route_path, or maybe route.

{
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
Introduce concept of a database `route`, separate from its name 1174306154  
1073043713 https://github.com/simonw/datasette/issues/1668#issuecomment-1073043713 https://api.github.com/repos/simonw/datasette/issues/1668 IC_kwDOBm6k_c4_9VkB simonw 9599 2022-03-19T16:56:19Z 2022-03-19T16:56:19Z OWNER

Worth noting that the name right now is picked automatically to avoid conflicts:

https://github.com/simonw/datasette/blob/61419388c134001118aaf7dfb913562d467d7913/datasette/app.py#L397-L413

{
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
Introduce concept of a database `route`, separate from its name 1174306154  
1073043350 https://github.com/simonw/datasette/issues/1668#issuecomment-1073043350 https://api.github.com/repos/simonw/datasette/issues/1668 IC_kwDOBm6k_c4_9VeW simonw 9599 2022-03-19T16:54:26Z 2022-03-19T16:54:26Z OWNER

The Database class already has a path property but it means something else - it's the path to the .db file on disk:

https://github.com/simonw/datasette/blob/61419388c134001118aaf7dfb913562d467d7913/datasette/database.py#L29-L50

So need a different name for the path-that-is-used-in-the-URL.

{
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
Introduce concept of a database `route`, separate from its name 1174306154  

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