I\'m using a python for my backend API server. My backend connect to a DISTANT Postgres database using SQLALCHEMY (without flask-sqlalchemy because i need that connector eve
@skapin, I had solve the problem.As the server connect sql need a paramteter pool_pre_ping. how to fix “OperationalError: (psycopg2.OperationalError) server closed the connection unexpectedly”
from flask_sqlalchemy import SQLAlchemy as _BaseSQLAlchemy
class SQLAlchemy(_BaseSQLAlchemy):
def apply_pool_defaults(self, app, options):
super(SQLAlchemy, self).apply_pool_defaults(self, app, options)
options["pool_pre_ping"] = True
db = SQLAlchemy()