]> git.ipfire.org Git - thirdparty/psycopg.git/commitdiff
Added docs for AsyncCursor.stream()
authorDaniele Varrazzo <daniele.varrazzo@gmail.com>
Fri, 22 Jan 2021 18:04:14 +0000 (19:04 +0100)
committerDaniele Varrazzo <daniele.varrazzo@gmail.com>
Fri, 22 Jan 2021 18:04:14 +0000 (19:04 +0100)
docs/cursor.rst

index 0b307a083fac09f1904edf15045e99ebd2dce8ac..162165c5b96ecb7dc5b081af165de04a443dde11 100644 (file)
@@ -179,14 +179,19 @@ The `!AsyncCursor` class
     .. automethod:: executemany(query: Query, params_seq: Sequence[Args])
     .. automethod:: copy(statement: Query) -> AsyncCopy
 
-        .. note:: it must be called as ``async with cur.copy() as copy: ...``
+        .. note:: It must be called as ``async with cur.copy() as copy: ...``
+
+    .. automethod:: stream(query, params=None) -> AsyncIterable[Sequence[Any]]
+
+        .. note:: It must be called as ``async for record in cur.stream(query):
+            ...``
 
     .. automethod:: fetchone
     .. automethod:: fetchmany
     .. automethod:: fetchall
 
-    .. note:: you can also use ``async for record in cursor`` to iterate on
-        the async cursor results.
+    .. note:: You can also use ``async for record in cursor: ...`` to iterate
+        on the async cursor results.
 
 
 Cursor support objects