We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent cc891e3 commit 4aa65daCopy full SHA for 4aa65da
asyncpg/prepared_stmt.py
@@ -243,7 +243,12 @@ async def executemany(self, args, *, timeout: float=None):
243
"""
244
return await self.__do_execute(
245
lambda protocol: protocol.bind_execute_many(
246
- self._state, args, '', timeout))
+ self._state,
247
+ args,
248
+ portal_name='',
249
+ timeout=timeout,
250
+ return_rows=False,
251
+ ))
252
253
async def __do_execute(self, executor):
254
protocol = self._connection._protocol
tests/test_prepare.py
@@ -613,10 +613,15 @@ async def test_prepare_explicitly_named(self):
613
await self.con.prepare('select 1', name='foobar')
614
615
async def test_prepare_fetchmany(self):
616
- await self.con.execute('CREATE TABLE mytab (a int, b text)')
+ tr = self.con.transaction()
617
+ await tr.start()
618
+ try:
619
+ await self.con.execute('CREATE TABLE fetchmany (a int, b text)')
620
- stmt = await self.con.prepare(
- 'INSERT INTO mytab (a, b) VALUES ($1, $2) RETURNING a, b'
- )
621
- result = await stmt.fetchmany([(1, 'a'), (2, 'b'), (3, 'c')])
622
- self.assertEqual(result, [(1, 'a'), (2, 'b'), (3, 'c')])
+ stmt = await self.con.prepare(
+ 'INSERT INTO fetchmany (a, b) VALUES ($1, $2) RETURNING a, b'
623
+ )
624
+ result = await stmt.fetchmany([(1, 'a'), (2, 'b'), (3, 'c')])
625
+ self.assertEqual(result, [(1, 'a'), (2, 'b'), (3, 'c')])
626
+ finally:
627
+ await tr.rollback()
0 commit comments