{"html_url": "https://github.com/simonw/datasette/issues/1445#issuecomment-904024939", "issue_url": "https://api.github.com/repos/simonw/datasette/issues/1445", "id": 904024939, "node_id": "IC_kwDOBm6k_c414lNr", "user": {"value": 9599, "label": "simonw"}, "created_at": "2021-08-23T18:52:35Z", "updated_at": "2021-08-23T18:52:35Z", "author_association": "OWNER", "body": "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.\r\n\r\nI 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.", "reactions": "{\"total_count\": 0, \"+1\": 0, \"-1\": 0, \"laugh\": 0, \"hooray\": 0, \"confused\": 0, \"heart\": 0, \"rocket\": 0, \"eyes\": 0}", "issue": {"value": 977323133, "label": "Ability to search for text across all columns in a table"}, "performed_via_github_app": null} {"html_url": "https://github.com/simonw/datasette/issues/1445#issuecomment-904026253", "issue_url": "https://api.github.com/repos/simonw/datasette/issues/1445", "id": 904026253, "node_id": "IC_kwDOBm6k_c414liN", "user": {"value": 9599, "label": "simonw"}, "created_at": "2021-08-23T18:54:49Z", "updated_at": "2021-08-23T18:54:49Z", "author_association": "OWNER", "body": "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.\r\n\r\nI could tuck it away in the table cog menu, but that's a weird place for something like this to live.\r\n\r\nMaybe 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.", "reactions": "{\"total_count\": 0, \"+1\": 0, \"-1\": 0, \"laugh\": 0, \"hooray\": 0, \"confused\": 0, \"heart\": 0, \"rocket\": 0, \"eyes\": 0}", "issue": {"value": 977323133, "label": "Ability to search for text across all columns in a table"}, "performed_via_github_app": null} {"html_url": "https://github.com/simonw/datasette/issues/1445#issuecomment-904027166", "issue_url": "https://api.github.com/repos/simonw/datasette/issues/1445", "id": 904027166, "node_id": "IC_kwDOBm6k_c414lwe", "user": {"value": 9599, "label": "simonw"}, "created_at": "2021-08-23T18:56:20Z", "updated_at": "2021-08-23T18:56:20Z", "author_association": "OWNER", "body": "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.", "reactions": "{\"total_count\": 0, \"+1\": 0, \"-1\": 0, \"laugh\": 0, \"hooray\": 0, \"confused\": 0, \"heart\": 0, \"rocket\": 0, \"eyes\": 0}", "issue": {"value": 977323133, "label": "Ability to search for text across all columns in a table"}, "performed_via_github_app": null} {"html_url": "https://github.com/simonw/datasette/issues/1445#issuecomment-904036200", "issue_url": "https://api.github.com/repos/simonw/datasette/issues/1445", "id": 904036200, "node_id": "IC_kwDOBm6k_c414n9o", "user": {"value": 9599, "label": "simonw"}, "created_at": "2021-08-23T19:08:54Z", "updated_at": "2021-08-23T19:08:54Z", "author_association": "OWNER", "body": "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\r\n\r\n```sql\r\nwith tables as (\r\n select\r\n name as table_name\r\n from\r\n sqlite_master\r\n where\r\n type = 'table'\r\n),\r\nqueries as (\r\n select\r\n 'select ''' || tables.table_name || ''' as _table, rowid from \"' || tables.table_name || '\" where ' || group_concat(\r\n '\"' || name || '\" like ''%'' || :search || ''%''',\r\n ' or '\r\n ) as query\r\n from\r\n pragma_table_info(tables.table_name),\r\n tables\r\n group by\r\n tables.table_name\r\n)\r\nselect\r\n group_concat(query, ' union all ')\r\nfrom\r\n queries\r\n```\r\nThe SQL query this generates for larger databases is _extremely_ long - but it does seem to work for smaller databases.", "reactions": "{\"total_count\": 0, \"+1\": 0, \"-1\": 0, \"laugh\": 0, \"hooray\": 0, \"confused\": 0, \"heart\": 0, \"rocket\": 0, \"eyes\": 0}", "issue": {"value": 977323133, "label": "Ability to search for text across all columns in a table"}, "performed_via_github_app": null} {"html_url": "https://github.com/simonw/datasette/issues/1445#issuecomment-904037087", "issue_url": "https://api.github.com/repos/simonw/datasette/issues/1445", "id": 904037087, "node_id": "IC_kwDOBm6k_c414oLf", "user": {"value": 9599, "label": "simonw"}, "created_at": "2021-08-23T19:10:17Z", "updated_at": "2021-08-23T19:10:17Z", "author_association": "OWNER", "body": "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", "reactions": "{\"total_count\": 0, \"+1\": 0, \"-1\": 0, \"laugh\": 0, \"hooray\": 0, \"confused\": 0, \"heart\": 0, \"rocket\": 0, \"eyes\": 0}", "issue": {"value": 977323133, "label": "Ability to search for text across all columns in a table"}, "performed_via_github_app": null}