This function is used to fetch the dependents for the selected node. Args: conn: Connection object object_id: Object Id of the selected node. where: where clause for the sql query (optional) Returns: Dictionary of dependents for the sele
(self, conn, object_id, where=None)
| 522 | return dependencies |
| 523 | |
| 524 | def get_dependents(self, conn, object_id, where=None): |
| 525 | """ |
| 526 | This function is used to fetch the dependents for the selected node. |
| 527 | |
| 528 | Args: |
| 529 | conn: Connection object |
| 530 | object_id: Object Id of the selected node. |
| 531 | where: where clause for the sql query (optional) |
| 532 | |
| 533 | Returns: Dictionary of dependents for the selected node. |
| 534 | """ |
| 535 | # Set the sql_path |
| 536 | sql_path = 'depends/{0}/#{1}#'.format( |
| 537 | conn.manager.server_type, conn.manager.version) |
| 538 | |
| 539 | if where is None: |
| 540 | where_clause = "WHERE dep.refobjid={0}::oid".format(object_id) |
| 541 | else: |
| 542 | where_clause = where |
| 543 | |
| 544 | query = render_template("/".join([sql_path, 'dependents.sql']), |
| 545 | where_clause=where_clause) |
| 546 | # fetch the dependency for the selected object |
| 547 | dependents = self.__fetch_dependency(conn, query) |
| 548 | |
| 549 | return dependents |
| 550 | |
| 551 | def __fetch_dependency(self, conn, query, show_system_objects=None, |
| 552 | is_schema_diff=False): |
nothing calls this directly
no test coverage detected