Skip to content

[Feature Request] Retrieve column comments for SQLAlchemy Inspector#get_columns #581

@Spikhalskiy

Description

@Spikhalskiy

Describe the feature

In SQLAlchemy, Inspector#get_columns() returns a list of ReflectedColumn.
ReflectedColumn has a comment field.

    comment: NotRequired[Optional[str]]
    """comment for the column, if present.
    Only some dialects return this key
    """

Currently, Trino's implementation of SQLAlchemy dialect in trino.sqlalchemy.dialect.TrinoDialect#get_columns returns a dict with keys ['name', 'type','nullable','default'].
It would be great to support returning comments in the dialect to make them available in SQLAlchemy's Inspector.

Describe alternatives you've considered

Currently, we need to run a separate DESCRIBE schema_table query and manually merge the results with those from Inspector#get_columns().

Are you willing to submit PR?

  • Yes I am willing to submit a PR!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions