Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add possibility to set pool_pre_ping in configuration #600

Closed

Conversation

maximilianredt
Copy link

sqlalchemy got the option to set a pool_pre_ping in version 1.2 (http://docs.sqlalchemy.org/en/latest/core/engines.html). This should also be possible in flask-sqlalchemy.

@pigletfly
Copy link

There is a pull request already. #577

@rsyring
Copy link
Contributor

rsyring commented Mar 8, 2019

Thank you for your contribution and sorry this took so long. We opted to go in a different direction but it will solve your use case. Please see: #684

@rsyring rsyring closed this Mar 8, 2019
@kujiy
Copy link

kujiy commented May 15, 2020

Let me put an example here:

app.config['SQLALCHEMY_DATABASE_URI'] = 'sqlite://'

# >= Flask-SQLAlchemy 2.4.0 
app.config["SQLALCHEMY_ENGINE_OPTIONS"] = {
    "pool_pre_ping": True,
}

# Create database connection object
db = SQLAlchemy(app)

https://flask-security-too.readthedocs.io/en/stable/quickstart.html

image
https://flask-sqlalchemy.palletsprojects.com/en/2.x/config/

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Dec 5, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Development

Successfully merging this pull request may close these issues.

4 participants