sharkbound / PythonTwitchBotFramework

asynchronous twitchbot framework made in pure python
MIT License
100 stars 26 forks source link

Sugestion: Support for various database backends #29

Closed JustDevZero closed 3 years ago

JustDevZero commented 3 years ago

As I see the project uses sqlalchemy, I think makes no sense to just support mysql. It could be clever to not make a database locking.

sharkbound commented 3 years ago

i will see what i can do about adding support for others, need to first find all it supports

sharkbound commented 3 years ago

it is lower priority to get this done though, as mysql is quite common, but this will be looked into at some point

JustDevZero commented 3 years ago

Yay! Just to let you know, i forked your project and will try to implement it:

https://docs.sqlalchemy.org/en/13/core/engines.html

As i see your project doesn't use any specific mysql code, so theorically it should be a piece of cake to change it.

I can do a pull request, if you want went it's done.

JustDevZero commented 3 years ago

As promised @sharkbound doing the changes was really easy, as you don't use any mysql specific stuff.

A Pull Request has been created:

https://github.com/sharkbound/PythonTwitchBotFramework/pull/30

sharkbound commented 3 years ago

thanks, i will probably hand-pick the needed changes when i get to doing this, since there is a lot of minor formatting changes included in the PR. but i will be sure to credit you

sharkbound commented 3 years ago

i am closing this issue, keeping discussion on this in the comments for the PR

sharkbound commented 3 years ago

FYI, i am working on implementing this, i currently planning how to do it atm, as i am not sure that connection strings will all use the same format

JustDevZero commented 3 years ago

On the link I provided before you can check for the connection strings. But the TLDR is: Yes, they have all the same format but SQLITE which is a bit different.

sharkbound commented 3 years ago

i will be pushing a update to add multi-db support soonish, hopefully tonight

sharkbound commented 3 years ago

added in commit 863eb6585b3df865f7a62254f529398957e6e848