This has the side effect of breaking rowcount, as before, but can send
many executemany in the same pipeline.
`rowcount` is correct if `returning=True` is set instead, which is a
thing we can at least document, and makes sense: "if you want a result,
you flush the pipeline, dude".
if not pipeline:
# No-op re-entered inner pipeline block.
- try:
- yield self._pipeline
- finally:
- self._pipeline.sync()
+ yield self._pipeline
return
try:
if not pipeline:
# No-op re-entered inner pipeline block.
- try:
- yield self._pipeline
- finally:
- await self._pipeline.sync()
+ yield self._pipeline
return
try:
self._last_query = query
+ if returning:
+ yield from pipeline._sync_gen()
+
for cmd in self._conn._prepared.get_maintenance_commands():
yield from self._conn._exec_command(cmd)
[(10,), (20,)],
returning=False,
)
- assert cur.rowcount == 2
with pytest.raises(e.ProgrammingError, match="no result available"):
cur.fetchone()
assert cur.nextset() is None
[(10,), (20,)],
returning=False,
)
- assert cur.rowcount == 2
with pytest.raises(e.ProgrammingError, match="no result available"):
await cur.fetchone()
assert cur.nextset() is None