MCPcopy Create free account
hub / github.com/MagicStack/asyncpg / _accept_read_only

Function _accept_read_only

asyncpg/connect_utils.py:1171–1183  ·  view source on GitHub ↗

Verify the server has not set default_transaction_read_only=True

(should_be_read_only: bool)

Source from the content-addressed store, hash-verified

1169
1170
1171def _accept_read_only(should_be_read_only: bool):
1172 """
1173 Verify the server has not set default_transaction_read_only=True
1174 """
1175 async def can_be_used(connection):
1176 settings = connection.get_settings()
1177 is_readonly = getattr(settings, 'default_transaction_read_only', 'off')
1178
1179 if is_readonly == "on":
1180 return should_be_read_only
1181
1182 return await _accept_in_hot_standby(should_be_read_only)(connection)
1183 return can_be_used
1184
1185
1186async def _accept_any(_):

Callers 1

connect_utils.pyFile · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…