Skip to content

Commit f6851a5

Browse files
committed
max overflow
Enabled the passing of max_overflow to create_engine
1 parent 1e536d9 commit f6851a5

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

flask_sqlalchemy.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -676,6 +676,7 @@ def init_app(self, app):
676676
app.config.setdefault('SQLALCHEMY_POOL_SIZE', None)
677677
app.config.setdefault('SQLALCHEMY_POOL_TIMEOUT', None)
678678
app.config.setdefault('SQLALCHEMY_POOL_RECYCLE', None)
679+
app.config.setdefault('SQLALCHEMY_MAX_OVERFLOW', None)
679680
app.config.setdefault('SQLALCHEMY_COMMIT_ON_TEARDOWN', False)
680681

681682
if not hasattr(app, 'extensions'):
@@ -710,6 +711,7 @@ def _setdefault(optionkey, configkey):
710711
_setdefault('pool_size', 'SQLALCHEMY_POOL_SIZE')
711712
_setdefault('pool_timeout', 'SQLALCHEMY_POOL_TIMEOUT')
712713
_setdefault('pool_recycle', 'SQLALCHEMY_POOL_RECYCLE')
714+
_setdefault('max_overflow', 'SQLALCHEMY_MAX_OVERFLOW')
713715

714716
def apply_driver_hacks(self, app, info, options):
715717
"""This method is called before engine creation and used to inject

0 commit comments

Comments
 (0)