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

Abstract Database Calls #19

Open
jontyms opened this issue Feb 24, 2024 · 2 comments
Open

Abstract Database Calls #19

jontyms opened this issue Feb 24, 2024 · 2 comments
Labels
enhancement New feature or request

Comments

@jontyms
Copy link
Member

jontyms commented Feb 24, 2024

All database calls should be abstracted in a different module that should allow easier switching to Postgres in the future

@jeffreydivi
Copy link
Member

After discussions with @Helithumper, I disagree that going from one NoSQL walled garden to another is a good idea. Ideally, an ORM like SQLAlchemy should be used, which gives you options between different database types, and could even help ease the migration between different DB backends.

You should also find one that supports data type migrations. The migration from int to str for Discord snowflakes was a mess that you can see in the code right now. This should be purged from the earth if possible, and in the future, a DB migration would help clean this up.

However, here be dragons: the Kennelish code for pre-populating fields in forms + saving them to the database is very easy to mess up and is known to consist of risky code that must be heavily vetted. Peyton and I advise somehow limiting what can be pushed through this logic by using an allow-list of values scraped from either the Pydantic schema for the database or the sum of all database keys defined in the forms (those JSON files in forms).

I fully expect to have to do some consulting for this. You know where to find me.

Also for your enjoyment: https://sqlmodel.tiangolo.com. That should help you all a lot in this migration.

@Helithumper
Copy link
Contributor

Thought about this a little bit there's two parts to this.

One. Immigration tool in order to move the original data that's in dynamo into a local sequel database.

Two. Design of a local database. it doesn't have to be psql could be even be SQLite. It is incredibly simple given that it's a single table of not very many columns anyways.

I think the first part of this is to replace the current calls to dynamo DB with a function which returns back a list of users, and that should at least cover the large scale refactoring work that would need to be done in order for this to occur.

@jontyms jontyms added the enhancement New feature or request label Jul 12, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

3 participants