.. automethod:: close
- .. note:: you can use :ref:`with connect(): ...<with-statement>` to
+ .. note:: You can use :ref:`with connect(): ...<with-statement>` to
close the connection automatically when the block is exited.
.. autoattribute:: closed
.. automethod:: cursor
- .. note:: you can use :ref:`with conn.cursor(): ...<with-statement>`
+ .. note:: You can use :ref:`with conn.cursor(): ...<with-statement>`
to close the cursor automatically when the block is exited.
.. automethod:: rollback()
.. automethod:: transaction(savepoint_name: Optional[str] = None, force_rollback: bool = False) -> Transaction
- .. note:: it must be called as ``with conn.transaction() as tx: ...``
+ .. note:: It must be called as ``with conn.transaction() as tx: ...``
Inside a transaction block it will not be possible to call `commit()`
or `rollback()`.
.. automethod:: connect
.. automethod:: close
- .. note:: you can use ``async with`` to close the connection
+ .. note:: You can use ``async with`` to close the connection
automatically when the block is exited, but be careful about
the async quirkness: see :ref:`with-statement` for details.
.. automethod:: cursor
- .. note:: you can use ``async with`` to close the cursor
+ .. note:: You can use ``async with`` to close the cursor
automatically when the block is exited, but be careful about
the async quirkness: see :ref:`with-statement` for details.
.. automethod:: transaction(savepoint_name: Optional[str] = None, force_rollback: bool = False) -> AsyncTransaction
- .. note:: it must be called as ``async with conn.transaction() as tx: ...``.
+ .. note:: It must be called as ``async with conn.transaction() as tx: ...``.
.. automethod:: notifies
.. automethod:: set_client_encoding
.. warning::
- by default even a simple :sql:`SELECT` will start a transaction: in
+ By default even a simple :sql:`SELECT` will start a transaction: in
long-running programs, if no further action is taken, the session will
remain *idle in transaction*, an undesirable condition for several
reasons (locks are held by the session, tables bloat...). For long lived