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

Function compare_pre_validation

web/pgadmin/tools/schema_diff/__init__.py:990–1012  ·  view source on GitHub ↗

This function is used to validate transaction id and version compatibility :param trans_id: :param source_sid: :param target_sid: :return:

(trans_id, source_sid, target_sid)

Source from the content-addressed store, hash-verified

988
989
990def compare_pre_validation(trans_id, source_sid, target_sid):
991 """
992 This function is used to validate transaction id and version compatibility
993 :param trans_id:
994 :param source_sid:
995 :param target_sid:
996 :return:
997 """
998
999 status, error_msg, diff_model_obj, session_obj = \
1000 check_transaction_status(trans_id)
1001
1002 if error_msg == ERROR_MSG_TRANS_ID_NOT_FOUND:
1003 res = make_json_response(success=0, errormsg=error_msg, status=404)
1004 return False, res, None, None
1005
1006 # Server version compatibility check
1007 status, msg = check_version_compatibility(source_sid, target_sid)
1008 if not status:
1009 res = make_json_response(success=0, errormsg=msg, status=428)
1010 return False, res, None, None
1011
1012 return True, '', diff_model_obj, session_obj
1013
1014
1015@socketio.on('connect', namespace=SOCKETIO_NAMESPACE)

Callers 2

compare_databaseFunction · 0.85
compare_schemaFunction · 0.85

Calls 3

make_json_responseFunction · 0.90
check_transaction_statusFunction · 0.70

Tested by

no test coverage detected