Skip to content
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

Bow before the ORM! #86

Open
3 tasks
nphilipp opened this issue Jul 6, 2023 · 0 comments
Open
3 tasks

Bow before the ORM! #86

nphilipp opened this issue Jul 6, 2023 · 0 comments
Labels
contributing Improvements to contributing maintenance Something outside of a full-scale project simplification Simplifying code

Comments

@nphilipp
Copy link
Member

nphilipp commented Jul 6, 2023

Story Time

As a contributor to mirrors-countme,
I would like that I can use its databases easier and that their structures are well-defined,
so that I’m less likely to make mistakes.

As a contributor to or operator of mirrors-countme,
I would like to have a well-defined way to manage changes in the database structure,
so I don’t lose sleep over this when it happens.

Acceptance Criteria

  • The ad-hoc created databases are inspected and SQLAlchemy declarative models are created from this.
  • The code uses these model classes to operate on the databases rather than hand-written SQL.
  • The Alembic framework is used to manage changes in database schemas.

Background

Right now, database accesses are all hand-written SQL (all across the code), partly inspecting table structure in one place, partly creating indexes on the spot in another, so that it’s easiest to just run the tools and see how tables look like. A defined model would make this much more manageable and approachable.

Also, we just so skirted the need to change the DB structure which would have gotten really hairy. 😬

@nphilipp nphilipp added contributing Improvements to contributing simplification Simplifying code maintenance Something outside of a full-scale project labels Jul 6, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
contributing Improvements to contributing maintenance Something outside of a full-scale project simplification Simplifying code
Projects
No open projects
Development

No branches or pull requests

1 participant