{"html_url": "https://github.com/simonw/sqlite-utils/issues/220#issuecomment-783662968", "issue_url": "https://api.github.com/repos/simonw/sqlite-utils/issues/220", "id": 783662968, "node_id": "MDEyOklzc3VlQ29tbWVudDc4MzY2Mjk2OA==", "user": {"value": 649467, "label": "mhalle"}, "created_at": "2021-02-22T20:44:51Z", "updated_at": "2021-02-22T20:44:51Z", "author_association": "NONE", "body": "Actually, coming back to this, I have a clearer use case for enabling fts generation for views: making it easier to bring in text from lookup tables and other joins. \r\n\r\nThe datasette documentation describes populating an fts table like so:\r\n```\r\nINSERT INTO \"items_fts\" (rowid, name, description, category_name)\r\n SELECT items. rowid,\r\n items.name,\r\n items.description,\r\n categories.name\r\n FROM items JOIN categories ON items.category_id=categories.id;\r\n```\r\nAlternatively if you have fts support in sqlite_utils for views (which sqlite and fts5 support), you can do the same thing just by creating a view that captures the above joins as columns, then creating an fts table from that view. Such an fts table can be created using sqlite_utils, where one created with your method can't. \r\n\r\nThe resulting fts table can then be used by a whole family of related tables and views in the manner you described earlier in this issue. ", "reactions": "{\"total_count\": 0, \"+1\": 0, \"-1\": 0, \"laugh\": 0, \"hooray\": 0, \"confused\": 0, \"heart\": 0, \"rocket\": 0, \"eyes\": 0}", "issue": {"value": 783778672, "label": "Better error message for *_fts methods against views"}, "performed_via_github_app": null} {"html_url": "https://github.com/simonw/sqlite-utils/issues/220#issuecomment-761015218", "issue_url": "https://api.github.com/repos/simonw/sqlite-utils/issues/220", "id": 761015218, "node_id": "MDEyOklzc3VlQ29tbWVudDc2MTAxNTIxOA==", "user": {"value": 649467, "label": "mhalle"}, "created_at": "2021-01-15T15:40:08Z", "updated_at": "2021-01-15T15:40:08Z", "author_association": "NONE", "body": "Make sense. If you're coming from the sqlite3 side of things, rather than the datasette side, wanting the fts methods to work for views makes more sense. sqlite3 allows fts5 tables on views, so I was looking for CLI functionality to build the fts virtual tables. Ultimately, though, sharing fts virtual tables across tables and derivative views is likely more efficient. \r\n\r\nMaybe an explicit error message like, \"fts is not supported for views\" rather than just throwing an exception that the method doesn't exist\" might be helpful. Not critical though.\r\n\r\nThanks.", "reactions": "{\"total_count\": 1, \"+1\": 1, \"-1\": 0, \"laugh\": 0, \"hooray\": 0, \"confused\": 0, \"heart\": 0, \"rocket\": 0, \"eyes\": 0}", "issue": {"value": 783778672, "label": "Better error message for *_fts methods against views"}, "performed_via_github_app": null}