From: Daniele Varrazzo Date: Sat, 16 Oct 2021 10:16:56 +0000 (+0200) Subject: Highlight meaningful lines in transaction examples X-Git-Tag: 3.0.2~35 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=f53f2aca8cb4117dd6b04dbad77a2923f28ae2ce;p=thirdparty%2Fpsycopg.git Highlight meaningful lines in transaction examples --- diff --git a/docs/basic/transactions.rst b/docs/basic/transactions.rst index 1951b3127..c92da3779 100644 --- a/docs/basic/transactions.rst +++ b/docs/basic/transactions.rst @@ -63,7 +63,8 @@ with an exception): The code modified using a connection context will result in the following sequence of database statements: -.. code:: python +.. code-block:: python + :emphasize-lines: 1 with psycopg.connect() as conn: @@ -121,7 +122,8 @@ inside a transaction, such as :sql:`CREATE DATABASE`, :sql:`VACUUM`, With an autocommit transaction, the above sequence of operation results in: -.. code:: python +.. code-block:: python + :emphasize-lines: 1 with psycopg.connect(autocommit=True) as conn: @@ -162,7 +164,8 @@ Continuing the example above, if you want to use an autocommit connection but still wrap selected groups of commands inside an atomic transaction, you can use a `!transaction()` context: -.. code:: python +.. code-block:: python + :emphasize-lines: 8 with psycopg.connect(autocommit=True) as conn: