Skip to content

Conversation

@theneuralcraftsman
Copy link
Contributor

This PR addresses issue #1180, which requested adding MariaDB to the repository description, similar to how it was done for PyMySQL/mysqlclient in PyMySQL/mysqlclient#719.

Additionally, I updated the example code by incorporating try, except, and finally blocks to ensure proper error handling and cleanup when interacting with the database. This improves the robustness of the code and ensures that the connection is always closed, even in case of an error.

Changes made:

  • Added MariaDB to the repo description.
  • Updated the example with error handling and resource management using try, except, and finally.

Let me know if further changes are needed.

@methane
Copy link
Member

methane commented Sep 18, 2024

It reduces the robustness.

  • remove traceback from the error.
  • with statement ensures that connections closed always already.

You should avoid try statement as possible to write robust code.
Read the "A Philosophy of Software Design, 2nd Edition".

@methane methane closed this Sep 18, 2024
@theneuralcraftsman
Copy link
Contributor Author

theneuralcraftsman commented Sep 18, 2024

Thanks for the feedback and the book recommendation! I've reverted the try-except changes and updated the repository description to include MariaDB as requested. Please check PR(#1186).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants