MCPcopy
hub / github.com/psycopg/psycopg / xid

Method xid

psycopg/psycopg/_connection_base.py:617–628  ·  view source on GitHub ↗

Returns a `Xid` to pass to the `!tpc_*()` methods of this connection. The argument types and constraints are explained in :ref:`two-phase-commit`. The values passed to the method will be available on the returned object as the members `~Xid.format_id`, `~Xi

(self, format_id: int, gtrid: str, bqual: str)

Source from the content-addressed store, hash-verified

615 yield from self._pipeline._sync_gen()
616
617 def xid(self, format_id: int, gtrid: str, bqual: str) -> Xid:
618 """
619 Returns a `Xid` to pass to the `!tpc_*()` methods of this connection.
620
621 The argument types and constraints are explained in
622 :ref:`two-phase-commit`.
623
624 The values passed to the method will be available on the returned
625 object as the members `~Xid.format_id`, `~Xid.gtrid`, `~Xid.bqual`.
626 """
627 self._check_tpc()
628 return Xid.from_parts(format_id, gtrid, bqual)
629
630 def _tpc_begin_gen(self, xid: Xid | str) -> PQGen[None]:
631 self._check_tpc()

Callers 15

test_tpc_commitMethod · 0.80
test_tpc_rollbackMethod · 0.80
test_xid_encodingMethod · 0.80
test_xid_roundtripMethod · 0.80
test_xid_unicodeMethod · 0.80
make_xidMethod · 0.80
test_xidMethod · 0.80
test_tpc_commitMethod · 0.80

Calls 2

_check_tpcMethod · 0.95
from_partsMethod · 0.80

Tested by 15

test_tpc_commitMethod · 0.64
test_tpc_rollbackMethod · 0.64
test_xid_encodingMethod · 0.64
test_xid_roundtripMethod · 0.64
test_xid_unicodeMethod · 0.64
test_xidMethod · 0.64
test_tpc_commitMethod · 0.64