Repository navigation
Conversation
Publishes config/database.py from the installer's database stub and registers (DatabaseProvider, DatabaseConfig) in bootstrap/application.py. Re-running is idempotent; an existing config is kept unless --force. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
Superseded by a PR opened from the claude-tmgbedu account |
Codecov Report✅ All modified and coverable lines are covered by tests. 📢 Thoughts on this report? Let us know! |
This file contains hidden or 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
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.
Summary
Adds a core
database:installconsole command, registered byAppProviderso it's available before the database is set up.config/database.pyfrom the installer's database stub (--driver sqlite|postgres|mysql, defaultsqlite). An existing file is kept unless--forceis passed.(DatabaseProvider, DatabaseConfig)inbootstrap/application.py. It findsApplication(...)withastand inserts the provider and any missing imports at exact positions, so the file's formatting stays the same.DatabaseProvideris already listed, the command changes nothing. If no bootstrap file is found, it prints manual steps and exits 1.DRIVER_CLASSESis moved intoinstaller/plan.pyso the installer and this command use the same mapping.Reusable
InstallCommandbaseconsole/install_command.pygives every package the same install behavior through a fluent class builder:self.commands([...]).add_provideraccepts classes or dotted strings. Use strings for app-side configs and for optional extras that shouldn't be imported.--force,publish_file(skips existing files unless forced), and the AST-based registration inbootstrap/application.py(register_provider).database:installsubclasses it to add--driverand template rendering.ADR renumber
The ADR was renumbered from 035 → 041 (
docs/adr/041-database-install-command.md), and its index entry was updated. 035 collides with the Config-subclass ADR on #313. 036–040 are taken by main and the open PRs (#314/#315/#317/#318).Rebase
Rebased onto latest
origin/main(284d097). The only conflict was indocs/adr/AGENTS.md, where both index rows were kept.Test results
pytest tests/console/test_install_command.py tests/console/test_database_install_command.py: 23 passed--ignore=tests/masoniteorm/postgres --cov): 3352 passed, 10 skipped, coverage 91.69% (threshold 80)ruff check/ruff format --check: clean. The new test file needed reformatting, which was folded into the commit.basedpyright: no new errors. The one remaining error is pre-existing on main (ai/ai.py, unresolved optionallangchain.chat_modelsimport).example/fastapi-app: the first run created the config and registered the provider. The second run skipped both.🤖 Generated with Claude Code