MCPcopy Create free account
hub / github.com/pgadmin-org/pgadmin4 / clear_all_breakpoint

Function clear_all_breakpoint

web/pgadmin/tools/debugger/__init__.py:1566–1635  ·  view source on GitHub ↗

clear_all_breakpoint(trans_id) This method is responsible to clear all the breakpoint Parameters: trans_id - Transaction ID

(trans_id)

Source from the content-addressed store, hash-verified

1564)
1565@pga_login_required
1566def clear_all_breakpoint(trans_id):
1567 """
1568 clear_all_breakpoint(trans_id)
1569
1570 This method is responsible to clear all the breakpoint
1571
1572 Parameters:
1573 trans_id
1574 - Transaction ID
1575 """
1576
1577 de_inst = DebuggerInstance(trans_id)
1578 if de_inst.debugger_data is None:
1579 return make_json_response(
1580 data={
1581 'status': False,
1582 'result': SERVER_CONNECTION_CLOSED
1583 }
1584 )
1585 manager = get_driver(PG_DEFAULT_DRIVER).connection_manager(
1586 de_inst.debugger_data['server_id'])
1587 conn = manager.connection(
1588 did=de_inst.debugger_data['database_id'],
1589 conn_id=de_inst.debugger_data['exe_conn_id'])
1590
1591 # find the debugger version and execute the query accordingly
1592 template_path = get_debugger_template_path(de_inst)
1593
1594 status = True
1595 result = ''
1596
1597 if not conn.connected():
1598 status = False
1599 result = SERVER_CONNECTION_CLOSED
1600
1601 return make_json_response(
1602 data={'status': status, 'result': result}
1603 )
1604
1605 if 'breakpoint_list' in json.loads(request.data):
1606 line_numbers = []
1607 if json.loads(request.data)['breakpoint_list'] is not None and \
1608 json.loads(request.data)['breakpoint_list'] != '':
1609 line_numbers = json.loads(request.data)[
1610 'breakpoint_list'].split(",")
1611
1612 for line_no in line_numbers:
1613 sql = render_template(
1614 "/".join([template_path, "clear_breakpoint.sql"]),
1615 session_id=de_inst.debugger_data['session_id'],
1616 foid=de_inst.debugger_data['function_id'],
1617 line_number=line_no
1618 )
1619
1620 status, result = execute_dict_search_path(
1621 conn, sql, de_inst.debugger_data['search_path'])
1622 if not status:
1623 return internal_server_error(errormsg=result)

Callers

nothing calls this directly

Calls 10

DebuggerInstanceClass · 0.90
make_json_responseFunction · 0.90
get_driverFunction · 0.90
internal_server_errorFunction · 0.90
execute_dict_search_pathFunction · 0.85
connection_managerMethod · 0.80
connectionMethod · 0.80
joinMethod · 0.80
connectedMethod · 0.45

Tested by

no test coverage detected