mirror of
https://github.com/simonw/datasette.git
synced 2025-12-10 16:51:24 +01:00
Include views in SQL autocomplete, refs #1897
This commit is contained in:
parent
52bf222d48
commit
83a6872d1b
2 changed files with 5 additions and 0 deletions
|
|
@ -703,6 +703,10 @@ async def _table_columns(datasette, database_name):
|
|||
table_columns = {}
|
||||
for row in result.rows:
|
||||
table_columns.setdefault(row["table_name"], []).append(row["name"])
|
||||
# Add views
|
||||
db = datasette.get_database(database_name)
|
||||
for view_name in await db.view_names():
|
||||
table_columns[view_name] = []
|
||||
return table_columns
|
||||
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue