Skip to content

Commit

Permalink
Fix for hidden table bug, refs #2247, #2257
Browse files Browse the repository at this point in the history
  • Loading branch information
simonw committed Feb 7, 2024
1 parent 4b6d2af commit e5291a2
Showing 1 changed file with 4 additions and 6 deletions.
10 changes: 4 additions & 6 deletions datasette/database.py
Original file line number Diff line number Diff line change
Expand Up @@ -487,13 +487,11 @@ async def hidden_table_names(self):
)
).rows
]
# Add any from metadata.json
db_metadata = self.ds.metadata(database=self.name)
if "tables" in db_metadata:
# Add any tables marked as hidden in config
db_config = self.ds.config.get("databases", {}).get(self.name, {})
if "tables" in db_config:
hidden_tables += [
t
for t in db_metadata["tables"]
if db_metadata["tables"][t].get("hidden")
t for t in db_config["tables"] if db_config["tables"][t].get("hidden")
]
# Also mark as hidden any tables which start with the name of a hidden table
# e.g. "searchable_fts" implies "searchable_fts_content" should be hidden
Expand Down

0 comments on commit e5291a2

Please sign in to comment.