summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDaniele Varrazzo <daniele.varrazzo@gmail.com>2017-08-31 16:34:04 +0100
committerDaniele Varrazzo <daniele.varrazzo@gmail.com>2017-08-31 16:34:04 +0100
commit3ec06b88f0c25a2ee8bfa72e35c314bc42f47096 (patch)
tree26fa66b5be837ef16685ce2d3ae41cfed97027bb
parent75198a46d4164c7898c0f2405ea10448ab8e6d34 (diff)
downloadpsycopg2-3ec06b88f0c25a2ee8bfa72e35c314bc42f47096.tar.gz
Construct proper human sentences to describe execute_values()
With bonus typos dropped.
-rw-r--r--lib/extras.py17
1 files changed, 11 insertions, 6 deletions
diff --git a/lib/extras.py b/lib/extras.py
index 69c7f32..798b3d2 100644
--- a/lib/extras.py
+++ b/lib/extras.py
@@ -1178,7 +1178,7 @@ def execute_batch(cur, sql, argslist, page_size=100):
fewer multi-statement commands, each one containing at most *page_size*
statements, resulting in a reduced number of server roundtrips.
- After the execution of the functtion the `cursor.rowcount` property will
+ After the execution of the function the `cursor.rowcount` property will
**not** contain a total result.
"""
@@ -1201,10 +1201,15 @@ def execute_values(cur, sql, argslist, template=None, page_size=100):
*template*.
:param template: the snippet to merge to every item in *argslist* to
- compose the query. If *argslist* items are sequences it should contain
- positional placeholders (e.g. ``"(%s, %s, %s)"``, or ``"(%s, %s, 42)``"
- if there are constants value...); If *argslist* is items are mapping
- it should contain named placeholders (e.g. ``"(%(id)s, %(f1)s, 42)"``).
+ compose the query.
+
+ - If the *argslist* items are sequences it should contain positional
+ placeholders (e.g. ``"(%s, %s, %s)"``, or ``"(%s, %s, 42)``" if there
+ are constants value...).
+
+ - If the *argslist* items are mappings it should contain named
+ placeholders (e.g. ``"(%(id)s, %(f1)s, 42)"``).
+
If not specified, assume the arguments are sequence and use a simple
positional template (i.e. ``(%s, %s, ...)``), with the number of
placeholders sniffed by the first element in *argslist*.
@@ -1215,7 +1220,7 @@ def execute_values(cur, sql, argslist, template=None, page_size=100):
.. __: https://www.postgresql.org/docs/current/static/queries-values.html
- After the execution of the functtion the `cursor.rowcount` property will
+ After the execution of the function the `cursor.rowcount` property will
**not** contain a total result.
While :sql:`INSERT` is an obvious candidate for this function it is