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

Method run_ddl

piccolo/engine/sqlite.py:808–833  ·  view source on GitHub ↗

Connection pools aren't currently supported - the argument is there for consistency with other engines.

(self, ddl: str, in_pool: bool = False)

Source from the content-addressed store, hash-verified

806 return response
807
808 async def run_ddl(self, ddl: str, in_pool: bool = False):
809 """
810 Connection pools aren't currently supported - the argument is there
811 for consistency with other engines.
812 """
813 query_id = self.get_query_id()
814
815 if self.log_queries:
816 self.print_query(query_id=query_id, query=ddl)
817
818 # If running inside a transaction:
819 current_transaction = self.current_transaction.get()
820 if current_transaction:
821 response = await self._run_in_existing_connection(
822 connection=current_transaction.connection,
823 query=ddl,
824 )
825 else:
826 response = await self._run_in_new_connection(
827 query=ddl,
828 )
829
830 if self.log_responses:
831 self.print_response(query_id=query_id, response=response)
832
833 return response
834
835 def atomic(
836 self, transaction_type: TransactionType = TransactionType.deferred

Callers

nothing calls this directly

Calls 6

get_query_idMethod · 0.80
print_queryMethod · 0.80
getMethod · 0.80
print_responseMethod · 0.80

Tested by

no test coverage detected