(self)
| 613 | await self.con.prepare('select 1', name='foobar') |
| 614 | |
| 615 | async def test_prepare_fetchmany(self): |
| 616 | tr = self.con.transaction() |
| 617 | await tr.start() |
| 618 | try: |
| 619 | await self.con.execute('CREATE TABLE fetchmany (a int, b text)') |
| 620 | |
| 621 | stmt = await self.con.prepare( |
| 622 | '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() |