{"repo":"AmbitionEng/django-pgtransaction","free":true,"listed":false,"github":"https://github.com/AmbitionEng/django-pgtransaction","clone":"git clone https://github.com/AmbitionEng/django-pgtransaction.git","description":"A context manager/decorator which extends Django's atomic function with the ability to set isolation level and retries for a given transaction.","language":"Python","stars":63,"topics":["django","postgresql","transactions"],"license":"BSD-3-Clause","category":"databases-storage","readme_excerpt":"django-pgtransaction django-pgtransaction offers a drop-in replacement for the default django.db.transaction module which, when used on top of a PostgreSQL database, extends the functionality of that module with Postgres-specific features. At present, django-pgtransaction offers an extension of the django.db.transaction.atomic context manager/decorator which allows one to dynamically set transaction characteristics including: - Isolation level - Read mode (READ WRITE/READ ONLY) - Deferrability (DEFERRABLE/NOT DEFERRABLE) - Retry policy for Postgres locking exceptions See the quickstart below or the docs for examples. Quickstart After installation, set transaction characteristics using pgtransaction.atomic : Isolation Levels Set the isolation level for specific consistency guarantees: There are three isolation levels: pgtransaction.READ COMMITTED , pgtransaction.REPEATABLE READ , and pgtransaction.SERIALIZABLE . By default it inherits the parent isolation level, which is Django's default of \"READ COMMITTED\". Read-Only Transactions Read-only mode can be used queries that don't modify data: Deferrable Transactions Prevent serialization failures for long-running queries by blocking: Note: DEFERRABLE only works with SERIALIZABLE isolation level and READ ONLY mode. Retries for Concurrent Updates When using stricter isolation levels like pgtransaction.SERIALIZABLE , Postgres will throw serialization errors upon concurrent updates to rows. Use the retry argument with the decorator to","default_branch":null,"files":null,"tree":[],"storefront":"/r/AmbitionEng","claimed":false,"request_supported":{"post":"https://gitbuyer.com/r/AmbitionEng/django-pgtransaction/request-supported","requests":0},"note":"indexed from public GitHub; nothing is for sale on this page. Clone it from GitHub. Paid listings live at /search."}