MCPcopy
hub / github.com/psycopg/psycopg / _start_query

Method _start_query

psycopg/psycopg/_connection_base.py:538–548  ·  view source on GitHub ↗

Generator to start a transaction if necessary.

(self)

Source from the content-addressed store, hash-verified

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:

Callers

nothing calls this directly

Calls 3

_exec_commandMethod · 0.95
_get_tx_start_commandMethod · 0.95
_sync_genMethod · 0.80

Tested by

no test coverage detected