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

Method test_sql_dml_insert_21

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

Source from the content-addressed store, hash-verified

506 self.assertEqual(res, 'INSERT 0 2')
507
508 async def test_sql_dml_insert_21(self):
509 # CommandComplete tag (inserted rows) with RETURNING
510
511 query = '''
512 INSERT INTO "Document" (title) VALUES ('Report'), ('Briefing')
513 RETURNING id as my_id;
514 '''
515
516 res = await self.scon.fetch(query)
517 self.assert_shape(res, rows=2, columns=["my_id"])
518
519 # simple (text) protocol
520 res = await self.scon.execute(query)
521 self.assertEqual(res, 'INSERT 0 2')
522
523 # extended (binary) protocol because we used args
524 query = '''
525 INSERT INTO "Document" (title) VALUES ($1), ($2)
526 RETURNING id as my_id;
527 '''
528 res = await self.scon.execute(query, 'Report', 'Briefing')
529 self.assertEqual(res, 'INSERT 0 2')
530
531 async def test_sql_dml_insert_22(self):
532 # insert into link table

Callers

nothing calls this directly

Calls 2

executeMethod · 0.80
assert_shapeMethod · 0.45

Tested by

no test coverage detected