Drop mapping - #123
Merged
Merged
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
This PR removes the DTO mapping and (de)serialization surface area from LuYao.Data and aligns the remaining RecordTable/RecordRow APIs around a closed set of supported column types (no Nullable/arrays/enums except byte[] as Binary). The unit tests are updated accordingly by deleting mapping/serialization-related suites and adding new negative tests for unsupported column types.
Changes:
- Dropped mapping-related APIs (e.g.,
RecordMappingOptions,XCopy,NameFilter, row/table mapping helpers) and their corresponding unit tests. - Dropped binary serialization + JSON converter support (payload header/codec,
ToBytes/FromBytes, JSON converters) and their tests. - Simplified schema/type handling: schema no longer tracks nullability; column type support is explicitly closed and tests assert unsupported types throw.
Reviewed changes
Copilot reviewed 45 out of 45 changed files in this pull request and generated 6 comments.
Show a summary per file
| File | Description |
|---|---|
| tests/LuYao.Common.UnitTests/Data/RecordTableTests.cs | Removed nullable-column behavior tests. |
| tests/LuYao.Common.UnitTests/Data/RecordTableRowTests.cs | Removed unused LuYao.Data.Meta import after mapping removal. |
| tests/LuYao.Common.UnitTests/Data/RecordSerializationTests.cs | Removed binary serialization tests (file deleted). |
| tests/LuYao.Common.UnitTests/Data/RecordRowSemanticsTests.cs | Removed unused LuYao.Data.Meta import after mapping removal. |
| tests/LuYao.Common.UnitTests/Data/RecordQueryTests.cs | Removed dynamic query tests (FindByDynamic*). |
| tests/LuYao.Common.UnitTests/Data/RecordMappingOptionsTests.cs | Removed mapping options tests (file deleted). |
| tests/LuYao.Common.UnitTests/Data/RecordJsonConverterTests.cs | Removed JSON converter tests (file deleted). |
| tests/LuYao.Common.UnitTests/Data/RecordColumnCollectionTests.cs | Added tests asserting Nullable/array/enum/unknown column types throw. |
| tests/LuYao.Common.UnitTests/Data/RecordArrayTypeTests.cs | Removed array/binary column tests (file deleted). |
| tests/LuYao.Common.UnitTests/Data/NameFilterTests.cs | Removed NameFilter tests (file deleted). |
| tests/LuYao.Common.UnitTests/Data/Meta/XCopyTests.cs | Removed XCopy tests (file deleted). |
| tests/LuYao.Common.UnitTests/Data/Expression/XPropTests.cs | Removed XProp/XData tests (file deleted). |
| src/LuYao.Common/Data/UnsupportedTypeHandling.cs | Removed enum used by mapping options (file deleted). |
| src/LuYao.Common/Data/RecordTable/Query.cs | Removed FindByDynamic / FindAllByDynamic. |
| src/LuYao.Common/Data/RecordTable/Mapping.cs | Removed RecordTable DTO mapping helpers (file deleted). |
| src/LuYao.Common/Data/RecordTable/Binary.cs | Removed RecordTable binary serialization implementation (file deleted). |
| src/LuYao.Common/Data/RecordTable.cs | Updated GetSchema() to match new RecordSchema.ColumnDef shape. |
| src/LuYao.Common/Data/RecordSet/Binary.cs | Removed RecordSet binary serialization implementation (file deleted). |
| src/LuYao.Common/Data/RecordSchema.cs | Removed nullability from schema column definitions. |
| src/LuYao.Common/Data/RecordRow/Merge.cs | Removed row merge helpers relying on mapping (file deleted). |
| src/LuYao.Common/Data/RecordRow/Mapping.cs | Removed row mapping helpers (file deleted). |
| src/LuYao.Common/Data/RecordRow/DynamicMetaObject.cs | Removed dynamic binding implementation (file deleted). |
| src/LuYao.Common/Data/RecordRow.cs | Dropped IDynamicMetaObjectProvider implementation. |
| src/LuYao.Common/Data/RecordColumnType.cs | Updated column-type documentation to reflect closed supported set. |
| src/LuYao.Common/Data/RecordColumnStorageTarget.cs | Removed storage-target enum used by mapping attributes (file deleted). |
| src/LuYao.Common/Data/RecordColumnCollection.cs | Removed AddFrom mapping helpers; added Add(string, RecordColumnType) overload. |
| src/LuYao.Common/Data/RecordColumn.cs | Removed mapping interface (IXProp) and nullability metadata from columns. |
| src/LuYao.Common/Data/NameFilter.cs | Removed NameFilter implementation (file deleted). |
| src/LuYao.Common/Data/Meta/XProp.cs | Removed XProp reflection helper (file deleted). |
| src/LuYao.Common/Data/Meta/XData.cs | Removed XData helper (file deleted). |
| src/LuYao.Common/Data/Meta/IXProp.cs | Removed shared “property descriptor” abstraction (file deleted). |
| src/LuYao.Common/Data/Mapping/XCopy.cs | Removed mapping utility (file deleted). |
| src/LuYao.Common/Data/Mapping/RecordMappingOptions.cs | Removed mapping options (file deleted). |
| src/LuYao.Common/Data/Mapping/RecordMappingContext.cs | Removed mapping execution context (file deleted). |
| src/LuYao.Common/Data/Mapping/ColumnNameResolver.cs | Removed column-name resolution logic (file deleted). |
| src/LuYao.Common/Data/Json/RecordTableJsonConverter.cs | Removed JSON converter (file deleted). |
| src/LuYao.Common/Data/Json/RecordSetJsonConverter.cs | Removed JSON converter (file deleted). |
| src/LuYao.Common/Data/Helpers.cs | Simplified CLR type <-> RecordColumnType handling; removed nullable/enum/array normalization logic. |
| src/LuYao.Common/Data/ConversionFailureHandling.cs | Removed enum used by mapping options (file deleted). |
| src/LuYao.Common/Data/Binary/RecordPayloadCompression.cs | Removed payload compression enum (file deleted). |
| src/LuYao.Common/Data/Binary/RecordBinaryPayloadCodec.cs | Removed payload codec (file deleted). |
| src/LuYao.Common/Data/Binary/BinaryPayloadHeader.cs | Removed payload header helpers (file deleted). |
| src/LuYao.Common/Data/Attributes/RecordColumnStorageAttribute.cs | Removed mapping-related attribute (file deleted). |
| src/LuYao.Common/Data/Attributes/RecordColumnNameAttribute.cs | Removed mapping-related attribute (file deleted). |
| src/LuYao.Common/Data/Attributes/RecordAttribute.cs | Removed mapping-related base attribute (file deleted). |
Suppressed comments (1)
src/LuYao.Common/Data/RecordSchema.cs:36
- New/updated XML documentation comments should be written in English (repo guideline). This member doc comment was updated in the PR but remains in Chinese.
/// <summary>
/// 列的枚举类型标识。
/// </summary>
public RecordColumnType ColumnType { get; }
Comment on lines
51
to
55
| /// <summary> | ||
| /// 获取列是否为可空类型。 | ||
| /// </summary> | ||
| public bool IsNullable { get; } | ||
|
|
||
|
|
Comment on lines
8
to
12
| /// <summary> | ||
| /// 代表一行数据,提供对列存储数据集合中特定行数据的访问。 | ||
| /// </summary> | ||
| public partial struct RecordRow : IDynamicMetaObjectProvider | ||
| public partial struct RecordRow | ||
| { |
| return col; | ||
| } | ||
|
|
||
| /// <summary>根据封闭的 RecordColumnType 类型添加列。</summary> |
Comment on lines
6
to
9
| /// <summary> | ||
| /// 表示 Record 的列定义信息(列名 + 类型),用于序列化、传输或 Schema 比较。 | ||
| /// 表示 Record 的列定义信息(列名 + 类型),用于 Schema 比较。 | ||
| /// </summary> | ||
| public sealed class RecordSchema |
Comment on lines
3
to
6
| /// <summary> | ||
| /// 定义 <see cref="RecordColumn"/> 支持的所有基础列数据类型。 | ||
| /// 白名单封闭,不可外部扩展。可空性通过 <see cref="RecordColumn.IsNullable"/> 独立表达。 | ||
| /// 白名单封闭,不可外部扩展。除 Binary 对应的 byte[] 外,不支持数组、Nullable 和枚举。 | ||
| /// </summary> |
| } | ||
|
|
||
| /// <summary> | ||
| /// 验证列类型是否在白名单内,不在则抛出异常。 |
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.