feat(presto): get_catalog_names (#23599)

This commit is contained in:
Beto Dealmeida
2023-04-06 09:27:49 -07:00
committed by GitHub
parent 739adcb93c
commit e2e0ad5ef5
3 changed files with 33 additions and 1 deletions

View File

@@ -785,6 +785,17 @@ class PrestoEngineSpec(PrestoBaseEngineSpec):
results = cursor.fetchall()
return {row[0] for row in results}
@classmethod
def get_catalog_names(
cls,
database: Database,
inspector: Inspector,
) -> List[str]:
"""
Get all catalogs.
"""
return [catalog for (catalog,) in inspector.bind.execute("SHOW CATALOGS")]
@classmethod
def _create_column_info(
cls, name: str, data_type: types.TypeEngine