Hide FTS tables that have content=

* Hide FTS tables that have content=, closes #2477
This commit is contained in:
Simon Willison 2025-04-16 21:44:09 -07:00 committed by GitHub
commit f2485dce9c
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
4 changed files with 67 additions and 26 deletions

View file

@ -578,10 +578,22 @@ class Database:
SELECT name FROM fts3_shadow_tables
)
SELECT name FROM final ORDER BY 1
"""
)
]
# Also hide any FTS tables that have a content= argument
hidden_tables += [
x[0]
for x in await self.execute(
"""
SELECT name
FROM sqlite_master
WHERE sql LIKE '%VIRTUAL TABLE%'
AND sql LIKE '%USING FTS%'
AND sql LIKE '%content=%'
"""
)
]
has_spatialite = await self.execute_fn(detect_spatialite)
if has_spatialite: