pallets-eco / flask-session

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

Added schema and bind key as config options #201

Closed ericscales closed 5 months ago

ericscales commented 7 months ago

Adds schema and bind key as options for SQLAlchemy

Lxstr commented 6 months ago

Hi @ericscales just wondering if you could provide some background to this, eg why it's needed, how it works. I don't use SQLAlchemy so may be unaware.

ericscales commented 5 months ago

Sure thing. These are used as part of Flask-Sqlalchemy when you have multiple binds and a database with multiple schemas.

An example in my case is that I have two DBs I bind to - one is SQL Server and another is postgresql. So I use the functionality described here to setup binds: https://flask-sqlalchemy.palletsprojects.com/en/3.1.x/binds/

For the schemas, in my postgresql database, I may have a schema titled "main" and another titled "secondary". In both cases, the model object has bind = "xyz" and schema= "abc" added.

Lxstr commented 5 months ago

Thanks please try the latest release and let me know if that satisfies this need 😃