Warn that execute_write_fn(fn) should be a non-async function

This commit is contained in:
Simon Willison 2021-09-12 13:13:52 -07:00 committed by GitHub
commit b28b6cd2fe
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -664,6 +664,10 @@ This method works like ``.execute_write()``, but instead of a SQL statement you
The function can then perform multiple actions, safe in the knowledge that it has exclusive access to the single writable connection as long as it is executing.
.. warning::
``fn`` needs to be a regular function, not an ``async def`` function.
For example:
.. code-block:: python