diff options
author | Daniele Varrazzo <daniele.varrazzo@gmail.com> | 2022-10-20 21:31:18 +0200 |
---|---|---|
committer | Daniele Varrazzo <daniele.varrazzo@gmail.com> | 2022-10-20 21:31:18 +0200 |
commit | f401d0b738e05911b2a97a933b36fcbf23aba4d2 (patch) | |
tree | 617abffe353cef73ef1a1d78f90cf893007023be | |
parent | aabac5df31a764b812f6113a1b18d18974a61768 (diff) | |
download | psycopg2-f401d0b738e05911b2a97a933b36fcbf23aba4d2.tar.gz |
docs: fix reST syntax and whitespace in executemany examples
-rw-r--r-- | doc/src/cursor.rst | 6 | ||||
-rw-r--r-- | doc/src/extras.rst | 12 |
2 files changed, 11 insertions, 7 deletions
diff --git a/doc/src/cursor.rst b/doc/src/cursor.rst index b5b2990..a998b3c 100644 --- a/doc/src/cursor.rst +++ b/doc/src/cursor.rst @@ -207,10 +207,12 @@ The ``cursor`` class Parameters are bounded to the query using the same rules described in the `~cursor.execute()` method. - + + .. code:: python + >>> nums = ((1,), (5,), (10,)) >>> cur.executemany("INSERT INTO test (num) VALUES (%s)", nums) - + >>> tuples = ((123, "foo"), (42, "bar"), (23, "baz")) >>> cur.executemany("INSERT INTO test (num, data) VALUES (%s, %s)", tuples) diff --git a/doc/src/extras.rst b/doc/src/extras.rst index 30c8a6b..083379b 100644 --- a/doc/src/extras.rst +++ b/doc/src/extras.rst @@ -1029,11 +1029,13 @@ parameters. By reducing the number of server roundtrips the performance can be .. autofunction:: execute_batch - >>> nums = ((1,), (5,), (10,)) - >>> execute_batch(cur, "INSERT INTO test (num) VALUES (%s)", nums) - - >>> tuples = ((123, "foo"), (42, "bar"), (23, "baz")) - >>> execute_batch(cur, "INSERT INTO test (num, data) VALUES (%s, %s)", tuples) + .. code:: python + + >>> nums = ((1,), (5,), (10,)) + >>> execute_batch(cur, "INSERT INTO test (num) VALUES (%s)", nums) + + >>> tuples = ((123, "foo"), (42, "bar"), (23, "baz")) + >>> execute_batch(cur, "INSERT INTO test (num, data) VALUES (%s, %s)", tuples) .. versionadded:: 2.7 |