Skip to content

detect_fts should handle alternative table escaping #570

@simonw

Description

@simonw

sqlite-utils now uses a better way of escaping table names, which has highlighted a bug in Datasette.

Datasette has its own version of the detect_fts function - at

def detect_fts_sql(table):
return r"""
select name from sqlite_master
where rootpage = 0
and (
sql like '%VIRTUAL TABLE%USING FTS%content="{table}"%'
or (
tbl_name = "{table}"
and sql like '%VIRTUAL TABLE%USING FTS%'
)
)
""".format(
table=table
)
- which fails to pick up FTS tables created using the new escaping pattern.

Originally posted by @simonw in simonw/sqlite-utils#57 (comment)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions