def get_db_path()

in databao/duckdb/utils.py [0:0]


def get_db_path(conn: Any) -> str | None:
    """Get the database file path for DuckDB connection, or None if in-memory."""
    if isinstance(conn, DuckDBPyConnection):
        db_path = conn.execute("PRAGMA database_list").fetchone()
        if db_path is None:
            return None
        db_path = db_path[2]
        return None if db_path == "memory" else db_path
    return None