-
Notifications
You must be signed in to change notification settings - Fork 0
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
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
- Prepping for Alembic usage
…ons. This change enables dynamic database dialect configurations through Pydantic by ignoring attributes that are irrelevant to a given dialect.
- ignore .git and .venv during clean for speed - use `$(MAKE)` instead of `make` for reliability
This directory will be used to output ephemeral data, like pytest reports.
Also: - improve Makefile a bit w/ explicit PHONY targets - parallelize test jobs - continue all test jobs if any fail
Pytest report extras
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
nwiltsie
reviewed
Mar 25, 2024
…v issues during CICD.
Co-authored-by: Nick Wiltsie <nwiltsie@users.noreply.github.com>
Also: - improve Makefile a bit w/ explicit PHONY targets - parallelize test jobs - continue all test jobs if any fail
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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 theorybl-alembic init
orbl-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 bypyright
.