Hopefully this should be a quick answer for somebody. I've looked through the docs a bit, but still haven't found a definitive answer. I have a number of 'idle' connections that stick around, even if I perform a session.close() in SQLAlchemy. Are these idle connections the way SQLAlchemy/Postgres handle connection pooling?
This is the query I used to check db connection activity
SELECT * FROM pg_stat_activity ;
Here is sample code:
from flask import Flask
from flask.ext.sqlalchemy import SQLAlchemy
application = Flask(__name__)
application.config.from_object('config')
db = SQLAlchemy(application)
class Brand(db.Model):
    id = db.Column(db.Integer, primary_key=True)
@application.route('/')
def documentation():
    all = Brand.query.all()
    db.session.remove() #don't need this since it's called on teardown
    return str(len(all))
if __name__ == '__main__':
    application.run(host='0.0.0.0', debug=True)