Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 12 additions & 8 deletions explorer/schema.py
Original file line number Diff line number Diff line change
Expand Up @@ -73,14 +73,18 @@ def build_schema_info(connection_alias):
if not _include_table(table_name):
continue
td = []
table_description = connection.introspection.get_table_description(cursor, table_name)
for row in table_description:
column_name = row[0]
try:
field_type = connection.introspection.get_field_type(row[1], row)
except KeyError as e:
field_type = 'Unknown'
td.append((column_name, field_type))
try:
table_description = connection.introspection.get_table_description(cursor, table_name)
for row in table_description:
column_name = row[0]
try:
field_type = connection.introspection.get_field_type(row[1], row)
except KeyError as e:
field_type = 'Unknown'
td.append((column_name, field_type))
except Exception as e:
# td.append(('Permission denied', 'Unknown'))
continue
ret.append((table_name, td))
return ret

Expand Down