Skip to content

Support get_view_names #303

@yu-iskw

Description

@yu-iskw

Is your feature request related to a problem? Please describe.
I would like to catalog tables and views of Spanner on OpenMetadata. To do so, I would like to extract metadata of not only tables but also views.

Code to reproduce

from sqlalchemy import (
    Column,
    Integer,
    MetaData,
    String,
    Table,
    create_engine,
    inspect,
)

url = "spanner+spanner:///projects/xxx/instances/xxx/databases/xxx"
engine = create_engine(url)
metadata = MetaData(bind=engine)
insp = inspect(engine)

insp.get_view_names()

Error message

File ~/anaconda2/envs/python3.9/lib/python3.9/site-packages/sqlalchemy/engine/reflection.py:412, in Inspector.get_view_names(self, schema)
    404 """Return all view names in `schema`.
    405 
    406 :param schema: Optional, retrieve names from a non-default schema.
    407  For special quoting, use :class:`.quoted_name`.
    408 
    409 """
    411 with self._operation_context() as conn:
--> 412     return self.dialect.get_view_names(
    413         conn, schema, info_cache=self.info_cache
    414     )

File ~/anaconda2/envs/python3.9/lib/python3.9/site-packages/sqlalchemy/engine/interfaces.py:332, in Dialect.get_view_names(self, connection, schema, **kw)
    326 def get_view_names(self, connection, schema=None, **kw):
    327     """Return a list of all view names available in the database.
    328 
    329     :param schema: schema name to query, if not the default schema.
    330     """
--> 332     raise NotImplementedError()

NotImplementedError: 

Describe the solution you'd like
We can implement get_view_names.

Describe alternatives you've considered
N/A

Additional context
I am working on the issue of OpenMetadata.

Metadata

Metadata

Assignees

Labels

api: spannerIssues related to the googleapis/python-spanner-sqlalchemy API.priority: p3Desirable enhancement or fix. May not be included in next release.type: feature request‘Nice-to-have’ improvement, new feature or different behavior or design.

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions