feat(demo): add ddl and index management workflows#36
Conversation
|
Caution Review failedThe pull request is closed. WalkthroughIntroduces schema DDL preview capability and index lifecycle management across domain, infrastructure, and app layers. Adds new view models, services, records, DI registrations, and tests. ShellViewModel now coordinates table selection with new view models. Test utilities and host factory added. Tasks doc updated to reflect completed items. Changes
Sequence Diagram(s)sequenceDiagram
autonumber
actor User
participant ShellVM as ShellViewModel
participant SchemaVM as SchemaDesignerViewModel
participant DdlSvc as ISchemaDdlService
User->>ShellVM: Select table
ShellVM->>SchemaVM: SetTargetTable(table)
rect rgba(230,245,255,0.6)
note right of User: Generate CREATE preview
User->>SchemaVM: Execute GenerateCreatePreviewCommand
SchemaVM->>DdlSvc: BuildCreateTablePreviewAsync(schema)
DdlSvc-->>SchemaVM: DdlPreview
SchemaVM-->>User: PreviewUp/Down set, Operation set
end
rect rgba(245,230,255,0.6)
note right of User: Generate ALTER preview
User->>SchemaVM: Execute GenerateAlterPreviewCommand
SchemaVM->>DdlSvc: BuildAlterTablePreviewAsync(alteration)
DdlSvc-->>SchemaVM: DdlPreview
SchemaVM-->>User: PreviewUp/Down set, Operation set
end
rect rgba(255,240,230,0.6)
note right of User: Generate DROP preview
User->>SchemaVM: Execute GenerateDropPreviewCommand
SchemaVM->>DdlSvc: BuildDropTablePreviewAsync(tableName)
DdlSvc-->>SchemaVM: DdlPreview
SchemaVM-->>User: PreviewUp/Down set, Operation set
end
sequenceDiagram
autonumber
actor User
participant ShellVM as ShellViewModel
participant IndexVM as IndexManagerViewModel
participant IdxSvc as IIndexManagementService
participant FS as FileSystem
User->>ShellVM: Select table
ShellVM->>IndexVM: SetTargetTable(table)
rect rgba(230,255,240,0.6)
note right of User: Create index
User->>IndexVM: Execute CreateIndexCommand
IndexVM->>IdxSvc: CreateIndexAsync(request)
IdxSvc->>FS: Write placeholder index file
FS-->>IdxSvc: OK/Fail
IdxSvc-->>IndexVM: IndexOperationResult
IndexVM-->>User: StatusMessage / ErrorMessage
end
rect rgba(255,235,230,0.6)
note right of User: Drop index
User->>IndexVM: Execute DropIndexCommand(item)
IndexVM->>IdxSvc: DropIndexAsync(request)
IdxSvc->>FS: Delete index file
FS-->>IdxSvc: OK/Fail
IdxSvc-->>IndexVM: IndexOperationResult
IndexVM-->>User: StatusMessage / ErrorMessage
end
Estimated code review effort🎯 4 (Complex) | ⏱️ ~60 minutes Poem
✨ Finishing touches
🧪 Generate unit tests
📜 Recent review detailsConfiguration used: CodeRabbit UI Review profile: CHILL Plan: Pro 📒 Files selected for processing (20)
Comment |
There was a problem hiding this comment.
Pull Request Overview
This PR adds DDL and index management workflows to the demo application by implementing schema preview generation, filesystem-based index operations, and reactive viewmodel bindings. The changes complete milestone M2 tasks for basic schema operations.
- Add schema DDL preview domain contracts and infrastructure generator
- Implement filesystem-backed index management with command handlers
- Extend demo app with reactive viewmodels and testing infrastructure
Reviewed Changes
Copilot reviewed 20 out of 20 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
tests/XBase.Demo.App.Tests/TempCatalog.cs |
New test helper for creating temporary catalogs with table/index placeholders |
tests/XBase.Demo.App.Tests/ShellViewModelTests.cs |
Refactored to use shared host factory and extracted TempCatalog |
tests/XBase.Demo.App.Tests/SchemaDesignerViewModelTests.cs |
New tests for DDL preview generation workflows |
tests/XBase.Demo.App.Tests/IndexManagerViewModelTests.cs |
New tests for index create/drop operations |
tests/XBase.Demo.App.Tests/DemoHostFactory.cs |
Shared factory for creating test hosts |
src/demo/tasks.md |
Mark M2 milestone tasks as complete |
src/demo/XBase.Demo.Infrastructure/ServiceCollectionExtensions.cs |
Register new DDL and index management services |
src/demo/XBase.Demo.Infrastructure/Schema/TemplateSchemaDdlService.cs |
DDL script generator implementation |
src/demo/XBase.Demo.Infrastructure/Indexes/FileSystemIndexManagementService.cs |
Filesystem-based index lifecycle service |
src/demo/XBase.Demo.Domain/Services/Models/IndexRequests.cs |
Domain models for index operations |
src/demo/XBase.Demo.Domain/Services/ISchemaDdlService.cs |
Service interface for DDL generation |
src/demo/XBase.Demo.Domain/Services/IIndexManagementService.cs |
Service interface for index management |
src/demo/XBase.Demo.Domain/Schema/TableSchemaDefinition.cs |
Domain models for schema definitions |
src/demo/XBase.Demo.Domain/Schema/DdlPreview.cs |
Domain model for DDL preview results |
src/demo/XBase.Demo.App/ViewModels/ShellViewModel.cs |
Integrate schema designer and index manager viewmodels |
src/demo/XBase.Demo.App/ViewModels/SchemaDesignerViewModel.cs |
Reactive viewmodel for DDL preview generation |
src/demo/XBase.Demo.App/ViewModels/SchemaColumnViewModel.cs |
Viewmodel for column definitions |
src/demo/XBase.Demo.App/ViewModels/SchemaColumnChangeViewModel.cs |
Viewmodel for column change operations |
src/demo/XBase.Demo.App/ViewModels/IndexManagerViewModel.cs |
Reactive viewmodel for index operations |
src/demo/XBase.Demo.App/DependencyInjection/ServiceCollectionExtensions.cs |
Register new viewmodel services |
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
Summary
Testing
https://chatgpt.com/codex/tasks/task_e_68dd91b73a3483229bb10ff84d9b280a
Summary by CodeRabbit