Ability to list just FTS4 or FTS5 table names

This commit is contained in:
Simon Willison 2019-01-24 19:57:04 -08:00
commit 66fd63b119
8 changed files with 53 additions and 22 deletions

View file

@ -7,7 +7,7 @@ search_records = [
def test_enable_fts(fresh_db):
table = fresh_db["searchable"]
table.insert_all(search_records)
assert ["searchable"] == fresh_db.table_names
assert ["searchable"] == fresh_db.table_names()
table.enable_fts(["text", "country"], fts_version="FTS4")
assert [
"searchable",
@ -16,7 +16,7 @@ def test_enable_fts(fresh_db):
"searchable_fts_segdir",
"searchable_fts_docsize",
"searchable_fts_stat",
] == fresh_db.table_names
] == fresh_db.table_names()
assert [("tanuki are tricksters", "Japan", "foo")] == table.search("tanuki")
assert [("racoons are trash pandas", "USA", "bar")] == table.search("usa")
assert [] == table.search("bar")