MCPcopy Create free account
hub / github.com/piccolo-orm/piccolo / __aenter__

Method __aenter__

piccolo/engine/postgres.py:68–75  ·  view source on GitHub ↗
(self: Self)

Source from the content-addressed store, hash-verified

66 return response
67
68 async def __aenter__(self: Self) -> Self:
69 self._transaction = self.connection.transaction()
70 await self._transaction.start()
71 querystring = self.query.querystrings[0]
72 template, template_args = querystring.compile_string()
73
74 self._cursor = await self.connection.cursor(template, *template_args)
75 return self
76
77 async def __aexit__(self, exception_type, exception, traceback):
78 if exception:

Callers

nothing calls this directly

Calls 3

compile_stringMethod · 0.80
transactionMethod · 0.45
cursorMethod · 0.45

Tested by

no test coverage detected