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

Method run_ddl

piccolo/engine/postgres.py:567–585  ·  view source on GitHub ↗
(self, ddl: str, in_pool: bool = True)

Source from the content-addressed store, hash-verified

565 return response
566
567 async def run_ddl(self, ddl: str, in_pool: bool = True):
568 query_id = self.get_query_id()
569
570 if self.log_queries:
571 self.print_query(query_id=query_id, query=ddl)
572
573 # If running inside a transaction:
574 current_transaction = self.current_transaction.get()
575 if current_transaction:
576 response = await current_transaction.connection.fetch(ddl)
577 elif in_pool and self.pool:
578 response = await self._run_in_pool(ddl)
579 else:
580 response = await self._run_in_new_connection(ddl)
581
582 if self.log_responses:
583 self.print_response(query_id=query_id, response=response)
584
585 return response
586
587 def transform_response_to_dicts(self, results) -> list[dict]:
588 """

Callers

nothing calls this directly

Calls 6

_run_in_poolMethod · 0.95
get_query_idMethod · 0.80
print_queryMethod · 0.80
getMethod · 0.80
print_responseMethod · 0.80

Tested by

no test coverage detected