mirror of
https://github.com/getredash/redash.git
synced 2025-12-19 17:37:19 -05:00
clickhouse: display data types (#7490)
This commit is contained in:
@@ -78,7 +78,7 @@ class ClickHouse(BaseSQLQueryRunner):
|
||||
|
||||
def _get_tables(self, schema):
|
||||
query = """
|
||||
SELECT database, table, name
|
||||
SELECT database, table, name, type as data_type
|
||||
FROM system.columns
|
||||
WHERE database NOT IN ('system', 'information_schema', 'INFORMATION_SCHEMA')
|
||||
"""
|
||||
@@ -94,7 +94,7 @@ class ClickHouse(BaseSQLQueryRunner):
|
||||
if table_name not in schema:
|
||||
schema[table_name] = {"name": table_name, "columns": []}
|
||||
|
||||
schema[table_name]["columns"].append(row["name"])
|
||||
schema[table_name]["columns"].append({"name": row["name"], "type": row["data_type"]})
|
||||
|
||||
return list(schema.values())
|
||||
|
||||
|
||||
Reference in New Issue
Block a user