♻️ refactor(model): 固化列元数据字段契约 - #98
Merged
Merged
Conversation
Owner
Author
|
问题复现: |
Owner
Author
|
实现记录:本次将上述 4 个元数据收敛到 |
Owner
Author
|
验证记录: |
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.
背景
ColumnInfo是核心数据模型,但CodegenAnalyzer._build_table_info当前先构造对象,再动态挂载auto_increment、max_length、precision、scale。其中auto_increment不在 dataclass 定义内,静态类型检查、序列化和调用方契约都无法发现该字段。计划
auto_increment纳入ColumnInfo的正式字段,默认值保持兼容。ColumnInfo时直接传入元数据,不再动态添加属性。边界
不改变数据库元数据读取逻辑或生成模板语义;这是核心模型类型安全修复。没有性能基准,不预设性能提升。
实现与验证
uff check src tests scripts 与
uff format --check:通过。
Closes #97