Skip to content

Commit

Permalink
Override apply_driver_hacks method in AtomicProceduresMixin
Browse files Browse the repository at this point in the history
  • Loading branch information
epandurski committed Feb 18, 2019
1 parent 6d215e3 commit 7307c51
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions flask_signalbus/atomic.py
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,11 @@ class CustomSQLAlchemy(AtomicProceduresMixin, SQLAlchemy):
"""

def apply_driver_hacks(self, app, info, options):
if info.drivername != 'sqlite' and "isolation_level" not in options:
options["isolation_level"] = "REPEATABLE_READ"
return super().apply_driver_hacks(app, info, options)

def make_declarative_base(self, model, *args, **kwargs):
class model(_ModelUtilitiesMixin, model):
pass
Expand Down

0 comments on commit 7307c51

Please sign in to comment.