Skip to content

Commit e69283f

Browse files
authored
clickhouse: display data types (#7490)
1 parent 09ed3c4 commit e69283f

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

redash/query_runner/clickhouse.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,7 @@ def port(self, port):
7878

7979
def _get_tables(self, schema):
8080
query = """
81-
SELECT database, table, name
81+
SELECT database, table, name, type as data_type
8282
FROM system.columns
8383
WHERE database NOT IN ('system', 'information_schema', 'INFORMATION_SCHEMA')
8484
"""
@@ -94,7 +94,7 @@ def _get_tables(self, schema):
9494
if table_name not in schema:
9595
schema[table_name] = {"name": table_name, "columns": []}
9696

97-
schema[table_name]["columns"].append(row["name"])
97+
schema[table_name]["columns"].append({"name": row["name"], "type": row["data_type"]})
9898

9999
return list(schema.values())
100100

0 commit comments

Comments
 (0)