MCPcopy
hub / github.com/MagicStack/asyncpg / _Source

Class _Source

tests/test_copy.py:468–480  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

466
467 try:
468 class _Source:
469 def __init__(self):
470 self.rowcount = 0
471
472 def __aiter__(self):
473 return self
474
475 async def __anext__(self):
476 if self.rowcount >= 100:
477 raise StopAsyncIteration
478 else:
479 self.rowcount += 1
480 return b'a1' * 500000 + b'\t' + b'b1' * 500000 + b'\n'
481
482 res = await self.con.copy_to_table('copytab', source=_Source())
483

Calls

no outgoing calls

Used in the wild real call sites across dependent graphs

searching dependent graphs…