MCPcopy Index your code
hub / github.com/geldata/gel / test_sql_dml_insert_20

Method test_sql_dml_insert_20

tests/test_sql_dml.py:485–506  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

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

Callers

nothing calls this directly

Calls 2

executeMethod · 0.80
assert_shapeMethod · 0.45

Tested by

no test coverage detected