Closed paulbaumgarten closed 8 months ago
For the benefit of anyone else who comes across this post in the future, I just forked this repo and modified the code so that the database model was not loaded if an optional flag was passed to the constructor function. I was actually a little surprised when I bothered to look at the code at just how small this library was - very easy to fix myself. Pity others have commented that the repo itself seems unmaintained now.
Fixed from 0.6.0
Hello I have a project that was previously just using flask-session type filesystem which I am finally migrating over to sqlalchemy, but I've hit a snag.
This is throwing exception
sqlalchemy.exc.InvalidRequestError: Table 'sessions' is already defined for this MetaData instance. Specify 'extend_existing=True' to redefine options and columns on an existing Table object.
.I realise this is likely due to the fact that I am using the
db,Model.metadata.reflect
option. Is there a way I can either (1) have sqlaclemy reflect all tables except sessions, or (2) have flask-session not define it's own model? or (3) Any other creative fix?Many thanks