From f53f2aca8cb4117dd6b04dbad77a2923f28ae2ce Mon Sep 17 00:00:00 2001 From: Daniele Varrazzo Date: Sat, 16 Oct 2021 12:16:56 +0200 Subject: [PATCH] Highlight meaningful lines in transaction examples --- docs/basic/transactions.rst | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) 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: -- 2.47.2