bastisawesome / guessinggame_ttv

A Twitch bot to play a word guessing game
BSD 3-Clause "New" or "Revised" License
0 stars 1 forks source link

Use decorator and function to define DatabaseManager tables #17

Open bastisawesome opened 2 years ago

bastisawesome commented 2 years ago

Similar to the Interface module, the DatabaseManager class should utilise a decorator and function (like add_table) to define the schema, instead of manually defining. This mostly just makes declaring the schema a little cleaner and more automated, though care should be taken as any changes to the schema (adding a new table) would cause problems.

bastisawesome commented 2 years ago

This is being left opened to be implemented in some future, unplanned release. As of right now, there are no plans to implement this until a major rewrite of the database management class.

bastisawesome commented 6 months ago

Honestly, with the solution planned for #32, that really does make this obsolete. I'll leave this open, for now, with the added comment: SQLAlchemy pretty much does what I want here, I just don't like using it. Perhaps in the future I will migrate the DBManager to SQLAlchemy for this functionality. It should also make it possible to generate migrations automatically.