MCPcopy Index your code
hub / github.com/pgadmin-org/pgadmin4 / select_frame

Function select_frame

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

select_frame(trans_id, frame_id) This method is responsible to select the frame from stack info Parameters: trans_id - Transaction ID frame_id - Frame id selected

(trans_id, frame_id)

Source from the content-addressed store, hash-verified

1720)
1721@pga_login_required
1722def select_frame(trans_id, frame_id):
1723 """
1724 select_frame(trans_id, frame_id)
1725
1726 This method is responsible to select the frame from stack info
1727
1728 Parameters:
1729 trans_id
1730 - Transaction ID
1731 frame_id
1732 - Frame id selected
1733 """
1734 de_inst = DebuggerInstance(trans_id)
1735 if de_inst.debugger_data is None:
1736 return make_json_response(
1737 data={
1738 'status': False,
1739 'result': SERVER_CONNECTION_CLOSED
1740 }
1741 )
1742
1743 manager = get_driver(PG_DEFAULT_DRIVER).connection_manager(
1744 de_inst.debugger_data['server_id'])
1745 conn = manager.connection(
1746 did=de_inst.debugger_data['database_id'],
1747 conn_id=de_inst.debugger_data['exe_conn_id'])
1748
1749 # find the debugger version and execute the query accordingly
1750 dbg_version = de_inst.debugger_data['debugger_version']
1751 if dbg_version <= 2:
1752 template_path = DEBUGGER_SQL_V1_PATH
1753 else:
1754 template_path = DEBUGGER_SQL_V3_PATH
1755
1756 de_inst.debugger_data['frame_id'] = frame_id
1757 de_inst.update_session()
1758
1759 if conn.connected():
1760 sql = render_template(
1761 "/".join([template_path, "select_frame.sql"]),
1762 session_id=de_inst.debugger_data['session_id'],
1763 frame_id=frame_id
1764 )
1765
1766 status, result = execute_dict_search_path(
1767 conn, sql, de_inst.debugger_data['search_path'])
1768
1769 if result == BUSY:
1770 return make_json_response(
1771 data={'status': 'Busy', 'result': []}
1772 )
1773
1774 if not status:
1775 return internal_server_error(errormsg=result)
1776 else:
1777 status = False
1778 result = SERVER_CONNECTION_CLOSED
1779

Callers

nothing calls this directly

Calls 10

update_sessionMethod · 0.95
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