flask-session icon indicating copy to clipboard operation
flask-session copied to clipboard

Regular SQLAlchemy instead of Flask-SQLAlchemy?

Open zefoo opened this issue 6 years ago • 3 comments

I see under the hood this runs Flask-SQLAlchemy.

Is it possible to use regular SQLAlchemy? I'm thinking no, I don't think it's a drop in replacement.

If not, can I use Flask-SQLAlchemy and SQLAlchemy together? Where Flask-Session uses Flask-SQLAlchemy and everything else uses SQLAlchemy (and both share a connection string)?

zefoo avatar Feb 03 '19 18:02 zefoo

Flask session and flask-sqlalchemy work fine together, its how my current application is setup

you just need to assign the flask-sqlalchemy object to SESSION_SQLALCHEMY before you initialize the session object with app

init_db(app, db) app.config['SESSION_SQLALCHEMY'] = db sess.init_app(app) db.create_all()

ive got the above in my appfactory. db is an flask-sqlalchemy object

slastrina avatar May 24 '19 02:05 slastrina

@slastrina he's saying he's not using flask-sqlalchemy but only sqlalchemy

callamd avatar Oct 02 '19 09:10 callamd

Am open to a PR on this is anyone is willing

Lxstr avatar Feb 03 '24 13:02 Lxstr

Closing as not planned unless there is a PR

Lxstr avatar Feb 25 '24 07:02 Lxstr