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

Function check_transaction_status

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

This function is used to check the transaction id is available in the session object. Args: trans_id:

(trans_id)

Source from the content-addressed store, hash-verified

161
162
163def check_transaction_status(trans_id):
164 """
165 This function is used to check the transaction id
166 is available in the session object.
167
168 Args:
169 trans_id:
170 """
171
172 if 'schemaDiff' not in session:
173 return False, ERROR_MSG_TRANS_ID_NOT_FOUND, None, None
174
175 schema_diff_data = session['schemaDiff']
176
177 # Return from the function if transaction id not found
178 if str(trans_id) not in schema_diff_data:
179 return False, ERROR_MSG_TRANS_ID_NOT_FOUND, None, None
180
181 # Fetch the object for the specified transaction id.
182 # Use pickle.loads function to get the model object
183 session_obj = schema_diff_data[str(trans_id)]
184 diff_model_obj = pickle.loads(session_obj['diff_model_obj'])
185
186 return True, None, diff_model_obj, session_obj
187
188
189def update_session_diff_transaction(trans_id, session_obj, diff_model_obj):

Callers 2

ddl_compareFunction · 0.70
compare_pre_validationFunction · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected