You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Update PostgreSQL Multi-Database Orchestrator for New Output Variants
Overview
Integrate include patterns, output variants, and failure stub generation into PostgreSQL multi-database collection. This completes the multi-database collection feature with all v1.0 requirements.
Scope
What's Included:
Update collect_all_databases() signature in file:dbsurveyor-core/src/adapters/postgres/multi_database.rs:
Return MultiDatabaseOutput instead of MultiDatabaseResult
Accept config: &MultiDatabaseConfig with include patterns and output mode
Integrate include pattern filtering:
Update filter_databases() to accept both include and exclude patterns
Apply additive include semantics: start empty, add matches, then remove excludes
Reuse existing glob_match() function
Build appropriate MultiDatabaseOutput variant based on config.output_mode:
SingleBundle: Wrap existing MultiDatabaseResult in Bundle variant
OnePerDatabase: Build PerDatabase variant with manifest and schemas
Generate failure stub schemas for failed databases in PerDatabase mode:
Create DatabaseSchema with database_info.collection_status: CollectionStatus::Failed
Populate collection_metadata.warnings with error summary from DatabaseFailure
Include in schemas vector alongside successful schemas
Update collect_single_database() to preserve object failures:
Extract object_failures from DatabaseSchema.collection_metadata
Include in final output for both variants
Update integration tests to verify both output modes:
Test single bundle mode (existing behavior)
Test one-per-database mode with manifest and per-db files
Test failure stub generation when database collection fails
Add tests for include pattern filtering with real PostgreSQL server
What's Explicitly Out:
CLI serialization logic (handled in ticket:de2eeeb8-bfeb-4a11-98aa-84efc70568b2/4)
Manifest file format definition (handled in ticket:de2eeeb8-bfeb-4a11-98aa-84efc70568b2/4)
Update PostgreSQL Multi-Database Orchestrator for New Output Variants
Overview
Integrate include patterns, output variants, and failure stub generation into PostgreSQL multi-database collection. This completes the multi-database collection feature with all v1.0 requirements.
Scope
What's Included:
collect_all_databases()signature infile:dbsurveyor-core/src/adapters/postgres/multi_database.rs:MultiDatabaseOutputinstead ofMultiDatabaseResultconfig: &MultiDatabaseConfigwith include patterns and output modefilter_databases()to accept both include and exclude patternsglob_match()functionMultiDatabaseOutputvariant based onconfig.output_mode:MultiDatabaseResultinBundlevariantPerDatabasevariant with manifest and schemasPerDatabasemode:DatabaseSchemawithdatabase_info.collection_status: CollectionStatus::Failedcollection_metadata.warningswith error summary fromDatabaseFailureschemasvector alongside successful schemascollect_single_database()to preserve object failures:object_failuresfromDatabaseSchema.collection_metadataWhat's Explicitly Out:
ticket:de2eeeb8-bfeb-4a11-98aa-84efc70568b2/4)ticket:de2eeeb8-bfeb-4a11-98aa-84efc70568b2/4)Multi-Database Output Variants
graph TD Start[collect_all_databases] --> CheckMode{config.output_mode} CheckMode -->|SingleBundle| BuildBundle[Build MultiDatabaseResult] CheckMode -->|OnePerDatabase| BuildPerDB[Build manifest + schemas] BuildBundle --> WrapBundle[Wrap in Bundle variant] BuildPerDB --> CreateManifest[Create MultiDatabaseManifest] BuildPerDB --> CollectSchemas[Collect success schemas] BuildPerDB --> GenerateStubs[Generate failure stub schemas] CreateManifest --> CombinePerDB[Combine into PerDatabase variant] CollectSchemas --> CombinePerDB GenerateStubs --> CombinePerDB WrapBundle --> Return[Return MultiDatabaseOutput] CombinePerDB --> ReturnAcceptance Criteria
collect_all_databases()returnsMultiDatabaseOutputenumMultiDatabaseResult(backward compatible)collection_status: CollectionStatus::Failedcollection_metadata.warningscontaining error summaryReferences
spec:de2eeeb8-bfeb-4a11-98aa-84efc70568b2/820ca524-8c7d-4939-8097-f1158e7d67ea(Tech Plan - Multi-Database Orchestrator Extensions)spec:de2eeeb8-bfeb-4a11-98aa-84efc70568b2/661dbe3d-b679-4287-991e-26f4a0dd98b9(Flow 2 - single bundle default with opt-in)