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

Method run_querystring

piccolo/engine/postgres.py:539–565  ·  view source on GitHub ↗
(
        self, querystring: QueryString, in_pool: bool = True
    )

Source from the content-addressed store, hash-verified

537 return results
538
539 async def run_querystring(
540 self, querystring: QueryString, in_pool: bool = True
541 ):
542 query, query_args = querystring.compile_string(
543 engine_type=self.engine_type
544 )
545
546 query_id = self.get_query_id()
547
548 if self.log_queries:
549 self.print_query(query_id=query_id, query=querystring.__str__())
550
551 # If running inside a transaction:
552 current_transaction = self.current_transaction.get()
553 if current_transaction:
554 response = await current_transaction.connection.fetch(
555 query, *query_args
556 )
557 elif in_pool and self.pool:
558 response = await self._run_in_pool(query, query_args)
559 else:
560 response = await self._run_in_new_connection(query, query_args)
561
562 if self.log_responses:
563 self.print_response(query_id=query_id, response=response)
564
565 return response
566
567 async def run_ddl(self, ddl: str, in_pool: bool = True):
568 query_id = self.get_query_id()

Callers

nothing calls this directly

Calls 8

_run_in_poolMethod · 0.95
compile_stringMethod · 0.80
get_query_idMethod · 0.80
print_queryMethod · 0.80
getMethod · 0.80
print_responseMethod · 0.80
__str__Method · 0.45

Tested by

no test coverage detected