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

Add Alembic migration support to database libraries #51

Merged
merged 58 commits into from
Apr 8, 2024

Conversation

aholmes
Copy link
Member

@aholmes aholmes commented Mar 13, 2024

This PR adds integration with Alembic. The command bl-alembic enables the use of BL_Python's configuration system, dependency injection, use of the monorepo libraries, automatic database schema handling, support for both PostgreSQL and SQLite, and more. In addition, bl-alembic is intended to make getting started much simpler in new projects. In theory bl-alembic init or bl-alembic upgrade head will kick off everything needed to gain everything this PR offers.

Test coverage is limited, but hits most of the important parts. Don't believe the coverage % for BLAlembic. While most of the code is indeed executed, many of the possible failures and expectations are not explicitly tested.

Review #52 for some unrelated changes merged into this branch that will be merged into main.

Shell errors will be addressed in a separate PR. See #55.

This PR has changes under src/database/typings/ that do not need review. These files are type stubs automatically generated by pyright.

@aholmes aholmes changed the base branch from aholmes-add-postgresql-support to main March 19, 2024 18:07
This command wraps `alembic` and generated a default `alembic.ini` if
one is not specified on the command line. This will allow us to provide
a default configuration file without requiring additional setup by users
of the tool.

Still to figure out: what the convention is for the location of database
migration files in general, and for scaffolded applications. They will
likely not follow the same conventions.
- Added documentation
- Added logs
- Organized code
- Fixed errors in code
@aholmes aholmes marked this pull request as ready for review March 23, 2024 00:43
@aholmes aholmes requested a review from a team as a code owner March 23, 2024 00:43
src/database/MANIFEST.in Outdated Show resolved Hide resolved
@aholmes aholmes merged commit ed8c28c into main Apr 8, 2024
8 checks passed
@aholmes aholmes deleted the aholmes-add-alembic-support branch April 8, 2024 22:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: Done
Development

Successfully merging this pull request may close these issues.

6 participants