MCPcopy
hub / github.com/psycopg/psycopg / count_xacts

Method count_xacts

tests/fix_psycopg.py:69–77  ·  view source on GitHub ↗

Return the number of prepared xacts currently in the test db.

(self)

Source from the content-addressed store, hash-verified

67 self.conn.execute("TRUNCATE test_tpc")
68
69 def count_xacts(self):
70 """Return the number of prepared xacts currently in the test db."""
71 cur = self.conn.execute(
72 """
73 select count(*) from pg_prepared_xacts
74 where database = %s""",
75 (self.conn.info.dbname,),
76 )
77 return cur.fetchone()[0]
78
79 def count_test_records(self):
80 """Return the number of records in the test table."""

Calls 2

executeMethod · 0.45
fetchoneMethod · 0.45