From: Daniele Varrazzo Date: Fri, 22 Jan 2021 18:04:14 +0000 (+0100) Subject: Added docs for AsyncCursor.stream() X-Git-Tag: 3.0.dev0~134 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=4f053f14901454a7c7895b527ddeb9d8ab57d7fe;p=thirdparty%2Fpsycopg.git Added docs for AsyncCursor.stream() --- diff --git a/docs/cursor.rst b/docs/cursor.rst index 0b307a083..162165c5b 100644 --- a/docs/cursor.rst +++ b/docs/cursor.rst @@ -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