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

Method transaction

asyncpg/connection.py:285–309  ·  view source on GitHub ↗

Create a :class:`~transaction.Transaction` object. Refer to `PostgreSQL documentation`_ on the meaning of transaction parameters. :param isolation: Transaction isolation mode, can be one of: `'serializable'`, `'repeatable_read'`,

(self, *, isolation=None, readonly=False,
                    deferrable=False)

Source from the content-addressed store, hash-verified

283 return self._protocol.get_settings()
284
285 def transaction(self, *, isolation=None, readonly=False,
286 deferrable=False):
287 """Create a :class:`~transaction.Transaction` object.
288
289 Refer to `PostgreSQL documentation`_ on the meaning of transaction
290 parameters.
291
292 :param isolation: Transaction isolation mode, can be one of:
293 `'serializable'`, `'repeatable_read'`,
294 `'read_uncommitted'`, `'read_committed'`. If not
295 specified, the behavior is up to the server and
296 session, which is usually ``read_committed``.
297
298 :param readonly: Specifies whether or not this transaction is
299 read-only.
300
301 :param deferrable: Specifies whether or not this transaction is
302 deferrable.
303
304 .. _`PostgreSQL documentation`:
305 https://www.postgresql.org/docs/
306 current/static/sql-set-transaction.html
307 """
308 self._check_open()
309 return transaction.Transaction(self, isolation, readonly, deferrable)
310
311 def is_in_transaction(self):
312 """Return True if Connection is currently inside a transaction.

Calls 1

_check_openMethod · 0.95