Generator to start a transaction if necessary.
(self)
| 536 | ) |
| 537 | |
| 538 | def _start_query(self) -> PQGen[None]: |
| 539 | """Generator to start a transaction if necessary.""" |
| 540 | if self._autocommit: |
| 541 | return |
| 542 | |
| 543 | if self.pgconn.transaction_status != IDLE: |
| 544 | return |
| 545 | |
| 546 | yield from self._exec_command(self._get_tx_start_command()) |
| 547 | if self._pipeline: |
| 548 | yield from self._pipeline._sync_gen() |
| 549 | |
| 550 | def _get_tx_start_command(self) -> bytes: |
| 551 | if self._begin_statement: |
nothing calls this directly
no test coverage detected