Begin work on switching out for sqlalchemy #15
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Planned implementation of multi DB support
TGDB cog api
Cog side api
This will get the
ctx.guild
and use that to look up the instancekey in the guild configIt will use that instance key to find the database and return it (or throw an tgcommon.NotFound exception)
This returns an TGAPIWithContext class, which has helper utility methods and can reference the self.db and self.ctx values
which are set as appropriate.
Cog's depending on the TGDB cog should roughly do the following
Future work this implies:
Commands/cogs demanding a minimum supported database schema level (starting at 5.10 obviously)
Only switch a cog to the new schema if absolutely necessary
Potentially supporting other databases? BeeSchema5.10.py? BeeAPIWithContext class?