Repository navigation
Add workspace_db_names(), document orphaned-DB cleanup in README - #35
Merged
Merged
Conversation
Investigated the reported __init__.py export gap for find_orphaned_dbs -- not reproducible: pgdevkit 0.7.0 (both the git tag and the published PyPI wheel) already imports and exports it correctly, and the `pgdb testdb clean --orphaned`/`list-orphaned` CLI surface PR #34's own description claimed to add is also present and documented. No bug found there. What was genuinely missing: a single-workspace analog of find_orphaned_dbs() for a caller that wants "which DB(s) does this exact worktree own right now" (e.g. before removing that one worktree) without sweeping the whole project. Added workspace_db_names(project_root=None), reusing the existing expected_db_names() naming helper. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
aersam
marked this pull request as ready for review
September 14, 2026 18:36
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
pgdevkit.testdb.workspace_db_names(project_root=None) -> frozenset[str]: the single-workspace analog offind_orphaned_dbs()— every DB name this exact worktree currently owns (main DB + configuredextra_db_suffixes), reusing the existingnaming.expected_db_names()helper. Needed bybdt cleanup(bmsuisse/devtools) to know which DB(s) belong to one specific worktree being removed, as opposed to a whole-project orphan sweep.find_orphaned_dbs()/clean_testdb(orphaned=True)/pgdb testdb list-orphaned/clean --orphanedin the README — this had no README coverage at all before.Test plan
ty check pgdevkitcleanpytest255 passedworkspace_db_names()🤖 Generated with Claude Code