Display schema and stored procedure information
()
| 77 | |
| 78 | @cli.command() |
| 79 | def 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() |
nothing calls this directly
no test coverage detected