(self)
| 483 | ) |
| 484 | |
| 485 | async def test_sql_dml_insert_20(self): |
| 486 | # CommandComplete tag (inserted rows) with no RETURNING |
| 487 | |
| 488 | query = ''' |
| 489 | INSERT INTO "Document" (title) VALUES ('Report'), ('Briefing'); |
| 490 | ''' |
| 491 | |
| 492 | # extended (binary) protocol, because fetch |
| 493 | res = await self.scon.fetch(query) |
| 494 | # actually, no DataRows are returned, but asyncpg returns [] anyway |
| 495 | self.assert_shape(res, 0, 0) |
| 496 | |
| 497 | # simple (text) protocol |
| 498 | res = await self.scon.execute(query) |
| 499 | self.assertEqual(res, 'INSERT 0 2') |
| 500 | |
| 501 | # extended (binary) protocol because we used args |
| 502 | query = ''' |
| 503 | INSERT INTO "Document" (title) VALUES ($1), ($2); |
| 504 | ''' |
| 505 | res = await self.scon.execute(query, 'Report', 'Briefing') |
| 506 | self.assertEqual(res, 'INSERT 0 2') |
| 507 | |
| 508 | async def test_sql_dml_insert_21(self): |
| 509 | # CommandComplete tag (inserted rows) with RETURNING |
nothing calls this directly
no test coverage detected