MCPcopy Create free account
hub / github.com/alibaba/GraphScope / ls

Function ls

python/graphscope/gsctl/commands/interactive/graph.py:79–102  ·  view source on GitHub ↗

Display schema and stored procedure information

()

Source from the content-addressed store, hash-verified

77
78@cli.command()
79def ls(): # noqa: F811
80 """Display schema and stored procedure information"""
81 tree = TreeDisplay()
82 # context
83 current_context = get_current_context()
84 try:
85 graphs = list_graphs()
86 using_graph = None
87 for g in graphs:
88 if g.id == current_context.context:
89 using_graph = g
90 break
91 # schema
92 tree.create_graph_node(using_graph)
93 # data source mapping
94 datasource_mapping = get_datasource_by_id(using_graph.id)
95 tree.create_datasource_mapping_node(using_graph, datasource_mapping)
96 # stored procedure
97 stored_procedures = list_stored_procedures(using_graph.id)
98 tree.create_stored_procedure_node(using_graph, stored_procedures)
99 except Exception as e:
100 err(f"Failed to display graph information: {str(e)}")
101 else:
102 tree.show(graph_identifier=current_context.context)
103
104
105@create.command()

Callers

nothing calls this directly

Calls 10

create_graph_nodeMethod · 0.95
showMethod · 0.95
TreeDisplayClass · 0.90
get_current_contextFunction · 0.90
list_graphsFunction · 0.90
get_datasource_by_idFunction · 0.90
list_stored_proceduresFunction · 0.90
errFunction · 0.90

Tested by

no test coverage detected