]> git.ipfire.org Git - thirdparty/psycopg.git/commitdiff
Highlight meaningful lines in transaction examples
authorDaniele Varrazzo <daniele.varrazzo@gmail.com>
Sat, 16 Oct 2021 10:16:56 +0000 (12:16 +0200)
committerDaniele Varrazzo <daniele.varrazzo@gmail.com>
Sat, 16 Oct 2021 10:16:56 +0000 (12:16 +0200)
docs/basic/transactions.rst

index 1951b3127822c12d3bfc76a8f1001cc0c850738e..c92da377966a8bbb793e238d0ec72dcbeca2b58c 100644 (file)
@@ -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: