Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

detect_fts should handle alternative table escaping #570

Closed
simonw opened this issue Sep 2, 2019 · 0 comments · Fixed by #571
Closed

detect_fts should handle alternative table escaping #570

simonw opened this issue Sep 2, 2019 · 0 comments · Fixed by #571

Comments

@simonw
Copy link
Owner

simonw commented Sep 2, 2019

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)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant