From 8a122438dd80b8cad9597708f6262046c8484bb9 Mon Sep 17 00:00:00 2001 From: Lee Goolsbee Date: Tue, 30 Apr 2024 16:27:01 -0500 Subject: [PATCH] add blurb to SqlAlchemySessionInterface docstring about table management options --- src/flask_session/sqlalchemy/sqlalchemy.py | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/flask_session/sqlalchemy/sqlalchemy.py b/src/flask_session/sqlalchemy/sqlalchemy.py index 012f906e..fe239ad9 100644 --- a/src/flask_session/sqlalchemy/sqlalchemy.py +++ b/src/flask_session/sqlalchemy/sqlalchemy.py @@ -48,6 +48,13 @@ def __repr__(self): class SqlAlchemySessionInterface(ServerSideSessionInterface): """Uses the Flask-SQLAlchemy from a flask app as session storage. + By default (``table_exists=False``) Flask-Session itself will create the table for session storage according to the + model defined by the ``create_session_model`` method. If ``table_exists`` is set to True, you're responsible—either + manually or via other tooling (e.g., Flask-Migrate)—for creating a table that matches the model, taking into account + the values (or defaults) provided via configuration parameters to the SQLAlchemy session interface (specifically + ``SESSION_SQLALCHEMY_TABLE``, ``SESSION_SQLALCHEMY_SCHEMA``, ``SESSION_SQLALCHEMY_BIND_KEY``, and + ``SESSION_SQLALCHEMY_SEQUENCE``). + :param app: A Flask app instance. :param client: A Flask-SQLAlchemy instance. :param key_prefix: A prefix that is added to all storage keys.