miguelgrinberg / APIFairy

A minimalistic API framework built on top of Flask, Marshmallow and friends.
MIT License
321 stars 30 forks source link

Flask Session with Alchemical #68

Open hackzaid opened 1 year ago

hackzaid commented 1 year ago

I see in APIFairy another variant of SQLAlchemy is being used; Alchemical. How do I set Flask Session to use Alchemical DB with APIFairy since Flask Session has already predifined SESSION_TYPEs which are:

null: NullSessionInterface (default)
redis: RedisSessionInterface
memcached: MemcachedSessionInterface
filesystem: FileSystemSessionInterface
mongodb: MongoDBSessionInterface
sqlalchemy: SqlAlchemySessionInterface
miguelgrinberg commented 1 year ago

You can use any database that you like in your project, since APIFary does not rely on any database services.

Also you seem to be confusing database sessions (provided, by SQLAlchemy, Flask-SQLAlchemy, Alchemical and others) with user sessions (provided by Flask-Session). Database sessions and user sessions are completely unrelated and have different purposes.

Also, looking in Flask-Session's documentation, it is clearly stated that to use the SQLAlchemy storage for your user session you have to use Flask-SQLAlchemy: https://flask-session.readthedocs.io/en/latest/#sqlalchemysessioninterface