MCPcopy
hub / github.com/sqlalchemy/sqlalchemy / pg_prepared_transaction

Method pg_prepared_transaction

test/requirements.py:975–990  ·  view source on GitHub ↗
(config)

Source from the content-addressed store, hash-verified

973 """Target database must support two-phase transactions."""
974
975 def pg_prepared_transaction(config):
976 if not against(config, "postgresql"):
977 return True
978
979 with config.db.connect() as conn:
980 try:
981 num = conn.scalar(
982 text(
983 "select cast(setting AS integer) from pg_settings "
984 "where name = 'max_prepared_transactions'"
985 )
986 )
987 except exc.OperationalError:
988 return False
989 else:
990 return num > 0
991
992 return skip_if(
993 [

Callers

nothing calls this directly

Calls 4

againstFunction · 0.90
textFunction · 0.90
connectMethod · 0.45
scalarMethod · 0.45

Tested by

no test coverage detected