by trashburger · 6y ago · 0 comments
https://github.com/DirkJanJansen/Pandora/blob/master/invoerI... What the heck is this supposed to be? Are you really creating a database table and then a connection, and executing that in the middle of some random code? You really need to separate this out. And this is not a cherrypicked complaint, this is the first file I randomly clicked in the repo.
https://github.com/DirkJanJansen/Pandora/search?q=create_eng... This looks like you're creating a new engine anywhere you need database access. This is NOT how you use SQLAlchemy. Create a database.py file that contains a SINGLE create_engine function, and define all your tables in one place. This code looks like a real mess.
Don't take this as a personal attack. We all had to start somewhere. But this is not something I'd call top quality or really even quality.
There's a French saying that goes "C'est en forgeant qu'on devient forgeron" (it is by "black-smithing" that one becomes a black-smith).
One way to discover best practices is by putting things out in the open and receiving benevolent feedback on how to do it better.
The code will improve as the author reads more about best practices to apply on a real project they have shared with the comunity, and a benevolent comunity submitting issues and pull requests.
Here's the link to create an issue in that repo:
If you are so concerned, fork it.