-
Notifications
You must be signed in to change notification settings - Fork 2
feat: Add SQL persistence for MIGs too (similar to AHBs) #236
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
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 <[email protected]>
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 <[email protected]>
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 <[email protected]>
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 <[email protected]>
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 <[email protected]>
b1e8759 to
acdb7c4
Compare
🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <[email protected]>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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 <[email protected]>
No description provided.