Allow for table creation to be optional to allow for table/schema management by other tooling#239
Conversation
e03e557 to
e77975e
Compare
b087de8 to
2d9ebc2
Compare
|
Thanks for the PR! @MauriceBrg has a similar PR for dynamo in #237. I'm thinking let's align the terminology with ...TABLE_EXISTS? And a similar addition to the docstring maybe |
…hema by other tooling (like Flask-Migrate)
2d9ebc2 to
beb9f34
Compare
|
@MauriceBrg Happy to align on terminology; I think I've folded in the requested updates? Let me know if there's anything else. |
|
Looks good to me in terms of naming, the DynamoDB version is For DynamoDB I added a bit more information about what the table needs to look like if you want to use an existing one. I'm not too familiar with SQL Alchemy so I don't know if it's worth adding something like that. |
|
@MauriceBrg lol; just realized I tagged you in my response that was meant for @Lxstr 😅 I'm all for better docs, but I'm not sure it's necessary to document the model schema in the docstring since the model definition exists just a few lines north of the interface class itself ( @Lxstr I think this is ready to go? |
|
Just wanted to +1 this. Speaking anecdotally, this would've been a welcome feature. I've had to introduce changes in my own app to account for the lack of such a feature. |
In previous versions of Flask-Session, table creation was intentionally removed to allow other tooling (e.g., Flask-Migrate) to manage table creation and schema updates, among other reasons.
It seems that in the shuffle of merging in changes from Flask-Session2, automatic table creation was re-added to Flask-Session, thus breaking application init and migrations for folks who manage their own tables and schemas.
This PR simply gates that behavior behind a configuration key to allow users to choose the behavior they prefer; the config key defaults to
Trueto reflect the current state.