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

Method test_sql_dml_insert_18

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

Source from the content-addressed store, hash-verified

443 )
444
445 async def test_sql_dml_insert_18(self):
446 res = await self.scon.fetch(
447 '''
448 WITH
449 a as (INSERT INTO "Child" (prop) VALUES ('a')),
450 b as (INSERT INTO "Child" (prop) VALUES ('b_0'), ('b_1'))
451 SELECT line FROM "Log" ORDER BY line;
452 '''
453 )
454 # changes to the database are not visible in the same query
455 self.assert_shape(res, 0, 0)
456
457 # so we need to re-select
458 res = await self.squery_values('SELECT line FROM "Log" ORDER BY line;')
459 self.assertEqual(
460 res,
461 [
462 ["inserted all"],
463 ["inserted each a"],
464 ["inserted each b_0"],
465 ["inserted each b_1"],
466 ],
467 )
468
469 async def test_sql_dml_insert_19(self):
470 # exclusive on base, then insert into base and child

Callers

nothing calls this directly

Calls 2

squery_valuesMethod · 0.80
assert_shapeMethod · 0.45

Tested by

no test coverage detected