MCPcopy
hub / github.com/tortoise/tortoise-orm / execute_many

Method execute_many

tortoise/backends/mysql/client.py:196–210  ·  view source on GitHub ↗
(self, query: str, values: list)

Source from the content-addressed store, hash-verified

194
195 @translate_exceptions
196 async def execute_many(self, query: str, values: list) -> None:
197 async with self.acquire_connection() as connection:
198 self.log.debug("%s: %s", query, values)
199 async with connection.cursor() as cursor:
200 if self.capabilities.supports_transactions:
201 await connection.begin()
202 try:
203 await cursor.executemany(query, values)
204 except Exception:
205 await connection.rollback()
206 raise
207 else:
208 await connection.commit()
209 else:
210 await cursor.executemany(query, values)
211
212 @translate_exceptions
213 async def execute_query(self, query: str, values: list | None = None) -> tuple[int, list[dict]]:

Callers

nothing calls this directly

Calls 4

acquire_connectionMethod · 0.95
beginMethod · 0.45
rollbackMethod · 0.45
commitMethod · 0.45

Tested by

no test coverage detected