The code that detects if specific tables have a corresponding FTS column is currently called from TableView - it should instead be handled as part of .inspect(). This will make it easier to build other features that need to behave differently depending on whether a table can be searched, e.g. an autocomplete widget for selecting filters from foreign key tables.
Current code:
|
# _search support: |
|
fts_table = None |
|
fts_sql = detect_fts_sql(table) |
|
fts_rows = list(await self.execute(name, fts_sql)) |
|
if fts_rows: |
|
fts_table = fts_rows[0][0] |
The code that detects if specific tables have a corresponding FTS column is currently called from TableView - it should instead be handled as part of
.inspect(). This will make it easier to build other features that need to behave differently depending on whether a table can be searched, e.g. an autocomplete widget for selecting filters from foreign key tables.Current code:
datasette/datasette/app.py
Lines 728 to 733 in f188cea