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

Function get_debugger_version

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

Function returns the debugger version. :param conn: :return:

(conn, search_path)

Source from the content-addressed store, hash-verified

686
687
688def get_debugger_version(conn, search_path):
689 """
690 Function returns the debugger version.
691 :param conn:
692 :return:
693 """
694 debugger_version = 0
695 status, res = conn.execute_void(SET_SEARCH_PATH.format(search_path))
696
697 if not status:
698 return False, internal_server_error(errormsg=res)
699
700 status, rid = conn.execute_scalar(
701 "SELECT COUNT(*) FROM pg_catalog.pg_proc p"
702 " LEFT JOIN pg_catalog.pg_namespace n ON p.pronamespace = n.oid"
703 " WHERE n.nspname = ANY(current_schemas(false)) AND"
704 " p.proname = 'pldbg_get_proxy_info';"
705 )
706
707 if not status:
708 return False, internal_server_error(errormsg=rid)
709
710 if int(rid) == 0:
711 debugger_version = 1
712 else:
713 status, rid = conn.execute_scalar(
714 "SELECT proxyapiver FROM pldbg_get_proxy_info();")
715
716 if status and rid in (2, 3):
717 debugger_version = rid
718
719 return True, debugger_version
720
721
722def validate_debug(conn, debug_type, is_superuser):

Callers 1

initialize_targetFunction · 0.85

Calls 3

internal_server_errorFunction · 0.90
execute_voidMethod · 0.45
execute_scalarMethod · 0.45

Tested by

no test coverage detected