Skip to content

Commit

Permalink
README: improve documentation of transactional.
Browse files Browse the repository at this point in the history
  • Loading branch information
Amirouche committed Apr 10, 2024
1 parent c1ecb14 commit fccbfc6
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -141,14 +141,19 @@ is `/etc/foundationdb/fdb.cluster`. Returns a database object.

### `await found.transactional(db, func, *args, snapshot=False, **kwargs)`

Operate a transaction for `func`.
Operate a transaction for `func`.

Coroutine that will operate a transaction against `db` for `func`. If
`snapshot=True` then the transaction is read-only. `func` will receive
an appropriate transaction object as first argument, then `args`, then
`kwargs`. Because of errors `transactional` might run `func` several
times, hence `func` should be idempotent.

The function `func` receive transaction object that should be passed
to other database functions. It has a property `vars` that is a
dictionary that can be used to cache objects for the extent of the
transaction.

### `await found.get(tx, key)`

Get the value associated with `key`.
Expand Down

0 comments on commit fccbfc6

Please sign in to comment.