diff --git a/src/_zkapauthorizer/model.py b/src/_zkapauthorizer/model.py index 78033374711c9b8d46e19b2af079f83292e96f88..12b0393b1eddc8869b55e759f4ebbfb99e03773a 100644 --- a/src/_zkapauthorizer/model.py +++ b/src/_zkapauthorizer/model.py @@ -186,6 +186,12 @@ def open_and_initialize(path, connect=None): def with_cursor(f): + """ + Decorate a function so it is automatically passed a cursor with an active + transaction as the first positional argument. If the function returns + normally then the transaction will be committed. Otherwise, the + transaction will be rolled back. + """ @wraps(f) def with_cursor(self, *a, **kw): with self._connection: