-
-
Notifications
You must be signed in to change notification settings - Fork 3.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat: External databases: reconnect to postgresql & mysql when connection is broken #2666
feat: External databases: reconnect to postgresql & mysql when connection is broken #2666
Conversation
6a10c0c
to
e1fa453
Compare
|
||
|
||
def register_peewee_databases(): | ||
register_database(MySQLDatabase, 'mysql') |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
mysql
isn't officially supported, this should be removed.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done
More testing wanted here but the rest LGTM! |
pass | ||
|
||
|
||
def register_peewee_databases(): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
perhaps we should also add SQLiteReconnectMixin
here? were you able to test this working using sqlite as well?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Currently I don't have any ideas how to reproduce disconnection from sqlite :(
Disconnection from pg can be easily triggered, so I added this to github action, can someone trigger them via approving workflow in this PR?
Any more work needed here? I think it's very important that we get this merged. |
I just need to verify it won't break the sqlite connections with 100% confidence then it's good to merge 👍 |
Yaaa... about that. I have not gotten this PR to work on a SQLite database thus far. |
@justinh-rahb are you stuck on this issue ? Do you need help on the matter, or is it work in progress ? I agree with you that this improvement is very important 🙂 |
Not sure if this is the right place, but should we be passing DATABASE_URL.
This would be useful in CI scenarios and/or deploying via AWS CloudFormation where:
|
hi! |
Created issue #3179 |
This won't get merged until we can confirm with 100% certainty that the sqlite issue gets fixed, help wanted here 🙌 |
In the past, the only ways i've been able to test severing the connection, are to either code up a test function to disconnect from the manager, or, the easier approach: rename the sqlite file, then wait a few seconds, and rename it back. |
Pull Request Checklist
Note to first-time contributors: Please open a discussion post in Discussions and describe your changes before submitting a pull request.
Before submitting, make sure you've checked the following:
dev
branch.Changelog Entry
Added
Additional Information
Based on #2660
Example exception occuring without added reconnect mixin in case of closed connection
Screenshots or Videos