(
self, querystring: QueryString, in_pool: bool = True
)
| 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() |
nothing calls this directly
no test coverage detected