feat: Add SQL persistence for MIGs too (similar to AHBs)#236
Merged
Conversation
Design for adding SQLModel support for Message Implementation Guides, mirroring the existing AHB SQLModel implementation patterns. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Add SQL model classes for MIGs mirroring the existing AHB SQLModel implementation patterns: - MigCode, MigDataElement, MigDataElementGroup, MigSegment, MigSegmentGroup, MigSegmentGroupLink, MessageImplementationGuide - from_model() and to_model() conversion methods - Position fields for stable list ordering - Self-referential SegmentGroup relationship via link table - SQL-only fields: gueltig_von, gueltig_bis, edifact_format_version Includes roundtrip tests verifying XML -> Pydantic -> SQL -> Pydantic equality for all example MIG files. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Update SQL Models section to include MIG support with code example. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Apply black/isort formatting and fix line-too-long pylint error. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
1a91d32 to
d306310
Compare
Pylint 4.0.4 incorrectly reports that Relationship fields (which are lists at runtime) don't have an 'append' member. This is a false positive specific to SQLModel's typing. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
b1e8759 to
acdb7c4
Compare
🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Contributor
There was a problem hiding this comment.
Pull request overview
This pull request adds SQL persistence support for Message Implementation Guides (MIGs), mirroring the existing implementation for Anwendungshandbücher (AHBs). The implementation enables storing and retrieving MIG data from SQL databases using SQLModel.
Key Changes:
- New SQLModel classes for all MIG components with proper relationships and constraints
- Comprehensive test suite with roundtrip validation for data integrity
- Updated module exports and documentation
Reviewed changes
Copilot reviewed 6 out of 7 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
src/fundamend/sqlmodels/messageimplementationguide.py |
Complete SQLModel implementation for MIG persistence, including 7 model classes with bidirectional conversion methods |
unittests/test_sqlmodels_messageimplementationguide.py |
Test suite covering single MIGs, MIGs with Uebertragungsdatei, example files, and submodule integration |
src/fundamend/sqlmodels/__init__.py |
Added exports for MIG-related SQLModel classes |
README.md |
Added documentation and code examples for MIG SQLModel usage |
src/fundamend/sqlmodels/anwendungshandbuch.py |
Added no-member to pylint disable list for consistency |
docs/plans/2026-01-07-mig-sqlmodels-design.md |
Design documentation detailing the implementation approach |
.gitignore |
Added .claude/ directory to ignore list |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
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.
No description provided.