Skip to content

FTS table detection should be part of .inspect() #240

@simonw

Description

@simonw

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

# _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]

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions