issue_comments
19 rows where issue = 657572753 and "updated_at" is on date 2020-10-15 sorted by updated_at descending
This data as json, CSV (advanced)
Suggested facets: created_at (date), updated_at (date)
issue 1
- ?sort=colname~numeric to sort by by column cast to real · 19 ✖
id | html_url | issue_url | node_id | user | created_at | updated_at ▲ | author_association | body | reactions | issue | performed_via_github_app |
---|---|---|---|---|---|---|---|---|---|---|---|
709575818 | https://github.com/simonw/datasette/issues/894#issuecomment-709575818 | https://api.github.com/repos/simonw/datasette/issues/894 | MDEyOklzc3VlQ29tbWVudDcwOTU3NTgxOA== | simonw 9599 | 2020-10-15T20:35:03Z | 2020-10-15T20:35:03Z | OWNER | Prototype so far: ```diff diff --git a/datasette/views/table.py b/datasette/views/table.py index ea11a51..d61f8bd 100644 --- a/datasette/views/table.py +++ b/datasette/views/table.py @@ -497,17 +497,32 @@ class TableView(RowTableShared): if sort and sort_desc: raise DatasetteError("Cannot use _sort and _sort_desc at the same time")
|
{ "total_count": 0, "+1": 0, "-1": 0, "laugh": 0, "hooray": 0, "confused": 0, "heart": 0, "rocket": 0, "eyes": 0 } |
?sort=colname~numeric to sort by by column cast to real 657572753 | |
709572425 | https://github.com/simonw/datasette/issues/894#issuecomment-709572425 | https://api.github.com/repos/simonw/datasette/issues/894 | MDEyOklzc3VlQ29tbWVudDcwOTU3MjQyNQ== | simonw 9599 | 2020-10-15T20:28:18Z | 2020-10-15T20:28:18Z | OWNER | Also need to rethink this template logic that decides if to show a column as sorted or not: https://github.com/simonw/datasette/blob/4f7c0ebd85ccd8c1853d7aa0147628f7c1b749cc/datasette/templates/_table.html#L10-L14 |
{ "total_count": 0, "+1": 0, "-1": 0, "laugh": 0, "hooray": 0, "confused": 0, "heart": 0, "rocket": 0, "eyes": 0 } |
?sort=colname~numeric to sort by by column cast to real 657572753 | |
709571143 | https://github.com/simonw/datasette/issues/894#issuecomment-709571143 | https://api.github.com/repos/simonw/datasette/issues/894 | MDEyOklzc3VlQ29tbWVudDcwOTU3MTE0Mw== | simonw 9599 | 2020-10-15T20:25:35Z | 2020-10-15T20:25:35Z | OWNER |
|
{ "total_count": 0, "+1": 0, "-1": 0, "laugh": 0, "hooray": 0, "confused": 0, "heart": 0, "rocket": 0, "eyes": 0 } |
?sort=colname~numeric to sort by by column cast to real 657572753 | |
709569951 | https://github.com/simonw/datasette/issues/894#issuecomment-709569951 | https://api.github.com/repos/simonw/datasette/issues/894 | MDEyOklzc3VlQ29tbWVudDcwOTU2OTk1MQ== | simonw 9599 | 2020-10-15T20:23:02Z | 2020-10-15T20:23:02Z | OWNER | Something to watch out for:
cast("100" as real) | "100" | cast(null as real) | cast("" as real) -- | -- | -- | -- 100.0 | 100 | | 0.0 |
{ "total_count": 0, "+1": 0, "-1": 0, "laugh": 0, "hooray": 0, "confused": 0, "heart": 0, "rocket": 0, "eyes": 0 } |
?sort=colname~numeric to sort by by column cast to real 657572753 | |
709562940 | https://github.com/simonw/datasette/issues/894#issuecomment-709562940 | https://api.github.com/repos/simonw/datasette/issues/894 | MDEyOklzc3VlQ29tbWVudDcwOTU2Mjk0MA== | simonw 9599 | 2020-10-15T20:08:16Z | 2020-10-15T20:08:16Z | OWNER | { "total_count": 0, "+1": 0, "-1": 0, "laugh": 0, "hooray": 0, "confused": 0, "heart": 0, "rocket": 0, "eyes": 0 } |
?sort=colname~numeric to sort by by column cast to real 657572753 | ||
709546976 | https://github.com/simonw/datasette/issues/894#issuecomment-709546976 | https://api.github.com/repos/simonw/datasette/issues/894 | MDEyOklzc3VlQ29tbWVudDcwOTU0Njk3Ng== | simonw 9599 | 2020-10-15T19:35:55Z | 2020-10-15T19:36:38Z | OWNER | Much easier solution: if the suffix is Using |
{ "total_count": 0, "+1": 0, "-1": 0, "laugh": 0, "hooray": 0, "confused": 0, "heart": 0, "rocket": 0, "eyes": 0 } |
?sort=colname~numeric to sort by by column cast to real 657572753 | |
709539257 | https://github.com/simonw/datasette/issues/894#issuecomment-709539257 | https://api.github.com/repos/simonw/datasette/issues/894 | MDEyOklzc3VlQ29tbWVudDcwOTUzOTI1Nw== | simonw 9599 | 2020-10-15T19:19:29Z | 2020-10-15T19:34:07Z | OWNER | Urgh this isn't going to work. I could use double-percentage-encoding here instead. I feel like there's a simpler solution that I'm missing (and that may well be in use within Datasette already, I'm not doing great thinking this morning). |
{ "total_count": 0, "+1": 0, "-1": 0, "laugh": 0, "hooray": 0, "confused": 0, "heart": 0, "rocket": 0, "eyes": 0 } |
?sort=colname~numeric to sort by by column cast to real 657572753 | |
709534197 | https://github.com/simonw/datasette/issues/894#issuecomment-709534197 | https://api.github.com/repos/simonw/datasette/issues/894 | MDEyOklzc3VlQ29tbWVudDcwOTUzNDE5Nw== | simonw 9599 | 2020-10-15T19:08:53Z | 2020-10-15T19:17:55Z | OWNER | Even better solution: use URL encoding in the parameter details. This is consistent with how So the format can be:
For most columns this will look like: For columns with a Problem: both
The other unreserved non-alphanumeric characters are Of these,
|
{ "total_count": 0, "+1": 0, "-1": 0, "laugh": 0, "hooray": 0, "confused": 0, "heart": 0, "rocket": 0, "eyes": 0 } |
?sort=colname~numeric to sort by by column cast to real 657572753 | |
709532369 | https://github.com/simonw/datasette/issues/894#issuecomment-709532369 | https://api.github.com/repos/simonw/datasette/issues/894 | MDEyOklzc3VlQ29tbWVudDcwOTUzMjM2OQ== | simonw 9599 | 2020-10-15T19:05:07Z | 2020-10-15T19:07:35Z | OWNER | Simpler option:
|
{ "total_count": 0, "+1": 0, "-1": 0, "laugh": 0, "hooray": 0, "confused": 0, "heart": 0, "rocket": 0, "eyes": 0 } |
?sort=colname~numeric to sort by by column cast to real 657572753 | |
709531343 | https://github.com/simonw/datasette/issues/894#issuecomment-709531343 | https://api.github.com/repos/simonw/datasette/issues/894 | MDEyOklzc3VlQ29tbWVudDcwOTUzMTM0Mw== | simonw 9599 | 2020-10-15T19:03:12Z | 2020-10-15T19:03:12Z | OWNER | The Sort by If it's going to include sort by numeric options it needs a different format - since Can I come up with a value syntax for this that is guaranteed not to clash with a weirdly named existing column? I think so. I could use |
{ "total_count": 0, "+1": 0, "-1": 0, "laugh": 0, "hooray": 0, "confused": 0, "heart": 0, "rocket": 0, "eyes": 0 } |
?sort=colname~numeric to sort by by column cast to real 657572753 | |
709525082 | https://github.com/simonw/datasette/issues/894#issuecomment-709525082 | https://api.github.com/repos/simonw/datasette/issues/894 | MDEyOklzc3VlQ29tbWVudDcwOTUyNTA4Mg== | simonw 9599 | 2020-10-15T18:51:59Z | 2020-10-15T18:51:59Z | OWNER | This is enough of a design to build a working prototype. |
{ "total_count": 0, "+1": 0, "-1": 0, "laugh": 0, "hooray": 0, "confused": 0, "heart": 0, "rocket": 0, "eyes": 0 } |
?sort=colname~numeric to sort by by column cast to real 657572753 | |
709505147 | https://github.com/simonw/datasette/issues/894#issuecomment-709505147 | https://api.github.com/repos/simonw/datasette/issues/894 | MDEyOklzc3VlQ29tbWVudDcwOTUwNTE0Nw== | simonw 9599 | 2020-10-15T18:18:45Z | 2020-10-15T18:50:50Z | OWNER | This needs querystring parameter design. Some options:
|
{ "total_count": 0, "+1": 0, "-1": 0, "laugh": 0, "hooray": 0, "confused": 0, "heart": 0, "rocket": 0, "eyes": 0 } |
?sort=colname~numeric to sort by by column cast to real 657572753 | |
709524123 | https://github.com/simonw/datasette/issues/894#issuecomment-709524123 | https://api.github.com/repos/simonw/datasette/issues/894 | MDEyOklzc3VlQ29tbWVudDcwOTUyNDEyMw== | simonw 9599 | 2020-10-15T18:50:25Z | 2020-10-15T18:50:25Z | OWNER | For the "Sort by X" select menu case... I could automatically expand that menu to contain extra options for "Sort numerically by X" for each TEXT column in the table. That's a pretty good option. For the action cog menu, I can add the extra options to the cog menu - and rely on the fact that the title of the page will say "Sorted numerically by colname descending". |
{ "total_count": 0, "+1": 0, "-1": 0, "laugh": 0, "hooray": 0, "confused": 0, "heart": 0, "rocket": 0, "eyes": 0 } |
?sort=colname~numeric to sort by by column cast to real 657572753 | |
709513483 | https://github.com/simonw/datasette/issues/894#issuecomment-709513483 | https://api.github.com/repos/simonw/datasette/issues/894 | MDEyOklzc3VlQ29tbWVudDcwOTUxMzQ4Mw== | simonw 9599 | 2020-10-15T18:31:56Z | 2020-10-15T18:31:56Z | OWNER | I think the first version of this feature involves implementing One question: how to reflect that this is happening in the current sort UI. This menu here for example: And this interface: how should it indicate that a text is currently sorted numerically v.s. sorted alphabetically, and allow the user to switch from one to the other? |
{ "total_count": 0, "+1": 0, "-1": 0, "laugh": 0, "hooray": 0, "confused": 0, "heart": 0, "rocket": 0, "eyes": 0 } |
?sort=colname~numeric to sort by by column cast to real 657572753 | |
709511399 | https://github.com/simonw/datasette/issues/894#issuecomment-709511399 | https://api.github.com/repos/simonw/datasette/issues/894 | MDEyOklzc3VlQ29tbWVudDcwOTUxMTM5OQ== | simonw 9599 | 2020-10-15T18:28:09Z | 2020-10-15T18:28:09Z | OWNER | The simplest solution would be for Python code to scan all of the visible values on the current page and show the column action for "sort by this numeric" based purely on that. I already do that in the JavaScript for "are there any blank values in the first page?" here: |
{ "total_count": 0, "+1": 0, "-1": 0, "laugh": 0, "hooray": 0, "confused": 0, "heart": 0, "rocket": 0, "eyes": 0 } |
?sort=colname~numeric to sort by by column cast to real 657572753 | |
709510422 | https://github.com/simonw/datasette/issues/894#issuecomment-709510422 | https://api.github.com/repos/simonw/datasette/issues/894 | MDEyOklzc3VlQ29tbWVudDcwOTUxMDQyMg== | simonw 9599 | 2020-10-15T18:26:25Z | 2020-10-15T18:26:25Z | OWNER | There's something interesting about figuring out which sort options should be offered in the column actions menu. Two options:
|
{ "total_count": 0, "+1": 0, "-1": 0, "laugh": 0, "hooray": 0, "confused": 0, "heart": 0, "rocket": 0, "eyes": 0 } |
?sort=colname~numeric to sort by by column cast to real 657572753 | |
709509635 | https://github.com/simonw/datasette/issues/894#issuecomment-709509635 | https://api.github.com/repos/simonw/datasette/issues/894 | MDEyOklzc3VlQ29tbWVudDcwOTUwOTYzNQ== | simonw 9599 | 2020-10-15T18:24:57Z | 2020-10-15T18:24:57Z | OWNER | This does feel like a weird plugin hook just because there aren't really THAT many different use-cases that plugins could solve. The ones I can think of are:
Could this work if I just allow One possible solution for the no-arbitrary-SQL case: users can define sort orders in
|
{ "total_count": 0, "+1": 0, "-1": 0, "laugh": 0, "hooray": 0, "confused": 0, "heart": 0, "rocket": 0, "eyes": 0 } |
?sort=colname~numeric to sort by by column cast to real 657572753 | |
709505953 | https://github.com/simonw/datasette/issues/894#issuecomment-709505953 | https://api.github.com/repos/simonw/datasette/issues/894 | MDEyOklzc3VlQ29tbWVudDcwOTUwNTk1Mw== | simonw 9599 | 2020-10-15T18:20:13Z | 2020-10-15T18:20:13Z | OWNER | Sorting by date when the column has a junk date format in it is such a column need it should maybe ship in Datasette by default - though I've been trying to avoid adding heavy dependencies like |
{ "total_count": 0, "+1": 0, "-1": 0, "laugh": 0, "hooray": 0, "confused": 0, "heart": 0, "rocket": 0, "eyes": 0 } |
?sort=colname~numeric to sort by by column cast to real 657572753 | |
709505608 | https://github.com/simonw/datasette/issues/894#issuecomment-709505608 | https://api.github.com/repos/simonw/datasette/issues/894 | MDEyOklzc3VlQ29tbWVudDcwOTUwNTYwOA== | simonw 9599 | 2020-10-15T18:19:35Z | 2020-10-15T18:19:35Z | OWNER | I could even let plugins define new sort types. Imagine a plugin that enables this:
|
{ "total_count": 0, "+1": 0, "-1": 0, "laugh": 0, "hooray": 0, "confused": 0, "heart": 0, "rocket": 0, "eyes": 0 } |
?sort=colname~numeric to sort by by column cast to real 657572753 |
Advanced export
JSON shape: default, array, newline-delimited, object
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]);
user 1