MCPcopy
hub / github.com/pandas-dev/pandas / get_all_views

Function get_all_views

pandas/tests/io/test_sql.py:512–534  ·  view source on GitHub ↗
(conn)

Source from the content-addressed store, hash-verified

510
511
512def get_all_views(conn):
513 if isinstance(conn, sqlite3.Connection):
514 c = conn.execute("SELECT name FROM sqlite_master WHERE type='view'")
515 return [view[0] for view in c.fetchall()]
516 else:
517 adbc = import_optional_dependency("adbc_driver_manager.dbapi", errors="ignore")
518 if adbc and isinstance(conn, adbc.Connection):
519 results = []
520 info = conn.adbc_get_objects().read_all().to_pylist()
521 for catalog in info:
522 catalog["catalog_name"]
523 for schema in catalog["catalog_db_schemas"]:
524 schema["db_schema_name"]
525 for table in schema["db_schema_tables"]:
526 if table["table_type"] == "view":
527 view_name = table["table_name"]
528 results.append(view_name)
529
530 return results
531 else:
532 from sqlalchemy import inspect
533
534 return inspect(conn).get_view_names()
535
536
537def get_all_tables(conn):

Callers 5

mysql_pymysql_engineFunction · 0.85
postgresql_adbc_connFunction · 0.85
sqlite_engineFunction · 0.85
sqlite_adbc_connFunction · 0.85

Calls 3

executeMethod · 0.45
appendMethod · 0.45

Tested by

no test coverage detected