refactor: Split monolithic sqlite.go into focused files (bd-0a43)
Split internal/storage/sqlite/sqlite.go (1050 lines) into focused files for better maintainability and code discovery: - store.go (306 lines): SQLiteStorage struct, New() constructor, initialization logic, and database utilities (Close, Path, IsClosed, UnderlyingDB, UnderlyingConn, CheckpointWAL) - queries.go (1173 lines): Issue CRUD operations including CreateIssue, GetIssue, GetIssueByExternalRef, UpdateIssue, UpdateIssueID, CloseIssue, DeleteIssue, DeleteIssues, SearchIssues with all helpers - config.go (95 lines): Configuration and metadata management (SetConfig, GetConfig, GetAllConfig, DeleteConfig, SetMetadata, GetMetadata) plus OrphanHandling type definitions - comments.go (83 lines): Comment operations (AddIssueComment, GetIssueComments) - sqlite.go (31 lines): Package documentation explaining file organization Additional changes: - Removed duplicate OrphanHandling definition from ids.go (was causing build error with new config.go) Impact: - Zero functional changes, all tests pass (2.6s runtime) - Improved code discovery: easy to locate specific functionality - Better maintainability: related code grouped logically - Reduced cognitive load: smaller, focused files 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
@@ -183,16 +183,6 @@ func tryResurrectParent(parentID string, issues []*types.Issue) bool {
|
||||
return false // Parent not in this batch
|
||||
}
|
||||
|
||||
// OrphanHandling defines how to handle missing parent issues during import
|
||||
type OrphanHandling string
|
||||
|
||||
const (
|
||||
OrphanStrict OrphanHandling = "strict" // Fail import on missing parent
|
||||
OrphanResurrect OrphanHandling = "resurrect" // Auto-resurrect from batch
|
||||
OrphanSkip OrphanHandling = "skip" // Skip orphaned issues
|
||||
OrphanAllow OrphanHandling = "allow" // Allow orphans (default)
|
||||
)
|
||||
|
||||
// EnsureIDs generates or validates IDs for issues
|
||||
// For issues with empty IDs, generates unique hash-based IDs
|
||||
// For issues with existing IDs, validates they match the prefix and parent exists (if hierarchical)
|
||||
|
||||
Reference in New Issue
Block a user