home / github

Menu
  • Search all tables
  • GraphQL API

issue_comments

Table actions
  • GraphQL API for issue_comments

5 rows where issue = 977323133 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

  • Ability to search for text across all columns in a table · 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
904037087 https://github.com/simonw/datasette/issues/1445#issuecomment-904037087 https://api.github.com/repos/simonw/datasette/issues/1445 IC_kwDOBm6k_c414oLf simonw 9599 2021-08-23T19:10:17Z 2021-08-23T19:10:17Z OWNER

Rather than trying to run that monstrosity in a single union all query, a better approach may be to use fetch() requests as seen in https://datasette.io/plugins/datasette-search-all

{
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
Ability to search for text across all columns in a table 977323133  
904036200 https://github.com/simonw/datasette/issues/1445#issuecomment-904036200 https://api.github.com/repos/simonw/datasette/issues/1445 IC_kwDOBm6k_c414n9o simonw 9599 2021-08-23T19:08:54Z 2021-08-23T19:08:54Z OWNER

Figured out a query for searching across every column in every table! https://til.simonwillison.net/datasette/search-all-columns-trick#user-content-same-trick-for-the-entire-database

sql with tables as ( select name as table_name from sqlite_master where type = 'table' ), queries as ( select 'select ''' || tables.table_name || ''' as _table, rowid from "' || tables.table_name || '" where ' || group_concat( '"' || name || '" like ''%'' || :search || ''%''', ' or ' ) as query from pragma_table_info(tables.table_name), tables group by tables.table_name ) select group_concat(query, ' union all ') from queries The SQL query this generates for larger databases is extremely long - but it does seem to work for smaller databases.

{
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
Ability to search for text across all columns in a table 977323133  
904027166 https://github.com/simonw/datasette/issues/1445#issuecomment-904027166 https://api.github.com/repos/simonw/datasette/issues/1445 IC_kwDOBm6k_c414lwe simonw 9599 2021-08-23T18:56:20Z 2021-08-23T18:56:20Z OWNER

A related but potentially even more useful ability would be running a search across every column of every table in a whole database. For anything less than a few 100MB this could be incredibly useful.

{
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
Ability to search for text across all columns in a table 977323133  
904026253 https://github.com/simonw/datasette/issues/1445#issuecomment-904026253 https://api.github.com/repos/simonw/datasette/issues/1445 IC_kwDOBm6k_c414liN simonw 9599 2021-08-23T18:54:49Z 2021-08-23T18:54:49Z OWNER

The bigger problem here is UI design. This feels like a pretty niche requirement to me, so adding a prominent search box to the table page (which already has the filters interface, plus the full-text search box for tables that have FTS configured) feels untidy.

I could tuck it away in the table cog menu, but that's a weird place for something like this to live.

Maybe add it as a new type of filter? Filters apply to specific columns though, so this would be the first filter that applied to all columns - which doesn't really fit the existing filter interface very well.

{
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
Ability to search for text across all columns in a table 977323133  
904024939 https://github.com/simonw/datasette/issues/1445#issuecomment-904024939 https://api.github.com/repos/simonw/datasette/issues/1445 IC_kwDOBm6k_c414lNr simonw 9599 2021-08-23T18:52:35Z 2021-08-23T18:52:35Z OWNER

The downside of the current implementation of this trick is that it only works for exact LIKE partial matches in a specific table - if you search for dog cat and dog appears in title but cat appears in description you won't get back that result.

I think that's fine though. If you want more advanced search there are other mechanisms you can use. This is meant to be a very quick and dirty starting point for exploring a brand new table.

{
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
Ability to search for text across all columns in a table 977323133  

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