MCPcopy Index your code
hub / github.com/piccolo-orm/piccolo / run

Method run

piccolo/engine/postgres.py:119–133  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

117 pass
118
119 async def run(self):
120 from piccolo.query.methods.objects import Create, GetOrCreate
121
122 try:
123 async with self.engine.transaction() as transaction:
124 await self.setup_transaction(transaction=transaction)
125 for query in self.queries:
126 if isinstance(query, (Query, DDL, Create, GetOrCreate)):
127 await query.run()
128 else:
129 raise ValueError("Unrecognised query")
130 self.queries = []
131 except Exception as exception:
132 self.queries = []
133 raise exception from exception
134
135 def run_sync(self):
136 return run_sync(self.run())

Callers 2

run_syncMethod · 0.95
__await__Method · 0.95

Calls 2

setup_transactionMethod · 0.95
transactionMethod · 0.45

Tested by

no test coverage detected