actio_python_utils.database_functions.savepoint

actio_python_utils.database_functions.savepoint(cur, savepoint='savepoint')[source]

Creates a context manager to create a savepoint upon entering, rollback if an error occurs, and release upon exiting

Parameters:
  • cur (cursor) – The psycopg2 cursor query to use

  • savepoint (str, default: 'savepoint') – The name to give to the savepoint

Return type:

None