pallets-eco / flask-session

Server side session extension for Flask
https://flask-session.readthedocs.io
BSD 3-Clause "New" or "Revised" License
501 stars 239 forks source link

Regular SQLAlchemy instead of Flask-SQLAlchemy? #95

Closed zefoo closed 7 months ago

zefoo commented 5 years ago

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)?

slastrina commented 5 years ago

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

callamd commented 5 years ago

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

Lxstr commented 8 months ago

Am open to a PR on this is anyone is willing

Lxstr commented 7 months ago

Closing as not planned unless there is a PR