mirror of
https://github.com/simonw/datasette.git
synced 2025-12-10 16:51:24 +01:00
Hide FTS tables that have content=
* Hide FTS tables that have content=, closes #2477
This commit is contained in:
parent
f6446b3095
commit
f2485dce9c
4 changed files with 67 additions and 26 deletions
|
|
@ -389,29 +389,6 @@ async def test_database_page(ds_client):
|
|||
},
|
||||
"private": False,
|
||||
},
|
||||
{
|
||||
"name": "searchable_fts",
|
||||
"columns": [
|
||||
"text1",
|
||||
"text2",
|
||||
"name with . and spaces",
|
||||
]
|
||||
+ (
|
||||
[
|
||||
"searchable_fts",
|
||||
"docid",
|
||||
"__langid",
|
||||
]
|
||||
if supports_table_xinfo()
|
||||
else []
|
||||
),
|
||||
"primary_keys": [],
|
||||
"count": 2,
|
||||
"hidden": False,
|
||||
"fts_table": "searchable_fts",
|
||||
"foreign_keys": {"incoming": [], "outgoing": []},
|
||||
"private": False,
|
||||
},
|
||||
{
|
||||
"name": "searchable_tags",
|
||||
"columns": ["searchable_id", "tag"],
|
||||
|
|
@ -538,6 +515,31 @@ async def test_database_page(ds_client):
|
|||
"foreign_keys": {"incoming": [], "outgoing": []},
|
||||
"private": False,
|
||||
},
|
||||
{
|
||||
"columns": Either(
|
||||
[
|
||||
"text1",
|
||||
"text2",
|
||||
"name with . and spaces",
|
||||
"searchable_fts",
|
||||
"docid",
|
||||
"__langid",
|
||||
],
|
||||
# Get tests to pass on SQLite 3.25 as well
|
||||
[
|
||||
"text1",
|
||||
"text2",
|
||||
"name with . and spaces",
|
||||
],
|
||||
),
|
||||
"count": 2,
|
||||
"foreign_keys": {"incoming": [], "outgoing": []},
|
||||
"fts_table": "searchable_fts",
|
||||
"hidden": True,
|
||||
"name": "searchable_fts",
|
||||
"primary_keys": [],
|
||||
"private": False,
|
||||
},
|
||||
{
|
||||
"name": "searchable_fts_docsize",
|
||||
"columns": ["docid", "size"],
|
||||
|
|
@ -1198,3 +1200,12 @@ async def test_upgrade_metadata(metadata, expected_config, expected_metadata):
|
|||
assert response.json() == expected_config
|
||||
response2 = await ds.client.get("/-/metadata.json")
|
||||
assert response2.json() == expected_metadata
|
||||
|
||||
|
||||
class Either:
|
||||
def __init__(self, a, b):
|
||||
self.a = a
|
||||
self.b = b
|
||||
|
||||
def __eq__(self, other):
|
||||
return other == self.a or other == self.b
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue