feat: Implement DBMLWriter and related interfaces for DBML file gener…#27
Merged
Conversation
There was a problem hiding this comment.
Pull request overview
Implements DBML generation for the parsed AL schema (Issue #8), adding a writer + schema post-processing, wiring it into DI, and introducing a comprehensive writer test suite.
Changes:
- Added
IDBMLWriter+ISchemaPostProcessorabstractions and a newDBMLWriterproject with concrete implementations. - Registered the writer/post-processor in
AL2DBML.DIand updated tests/solution references. - Extended
IAlParser/AlParserwithGetOutputSchema()to expose the accumulated parsed schema.
Reviewed changes
Copilot reviewed 14 out of 14 changed files in this pull request and generated 9 comments.
Show a summary per file
| File | Description |
|---|---|
| src/DBMLWriter/Writer.cs | Generates DBML text output from an OutputSchema (enums, tables, refs, flowfield notes). |
| src/DBMLWriter/SchemaPostProcessor.cs | Deep-copies and post-processes schema (unknown-field cleanup, PK inference, ref resolution). |
| src/DBMLWriter/DBMLWriter.csproj | New project packaging the writer implementation. |
| src/AL2DBML.Tests/Writer/WriterTests.cs | Adds DBML writer unit tests (quoting, refs, flowfields, unknown-field rules). |
| src/AL2DBML.Tests/TestBase.cs | Resolves IDBMLWriter from DI for test suites. |
| src/AL2DBML.Tests/AL2DBML.Tests.csproj | References the new DBMLWriter project. |
| src/AL2DBML.Parser/AlParser.cs | Implements GetOutputSchema() returning the parser’s accumulated schema. |
| src/AL2DBML.DI/WriterServiceExtensions.cs | Adds DI registrations for writer + post-processor. |
| src/AL2DBML.DI/AL2DbmlServiceExtensions.cs | Adds .AddWriter() to the default service registration chain. |
| src/AL2DBML.DI/AL2DBML.DI.csproj | References DBMLWriter from DI project. |
| src/AL2DBML.Application/Interfaces/ISchemaPostProcessor.cs | New schema post-processing interface. |
| src/AL2DBML.Application/Interfaces/IDBMLWriter.cs | New DBML writer interface. |
| src/AL2DBML.Application/Interfaces/IAlParser.cs | Adds GetOutputSchema() to parser contract. |
| AL2DBML.sln | Adds the new DBMLWriter project to the solution. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
… copy functionality
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.
…ation
Description
Closes
closes #8