Skip to content

Normalize TDS UDT and XML metadata types - #4812

Open
benrr101 wants to merge 10 commits into
dev/russellben/tokens/tdstypeinfofrom
dev/russellben/tokens/tdsudttypeinfo
Open

benrr101 wants to merge 10 commits into
dev/russellben/tokens/tdstypeinfofrom
dev/russellben/tokens/tdsudttypeinfo

Conversation

@benrr101

@benrr101 benrr101 commented Oct 9, 2026

Copy link
Copy Markdown
Contributor

Description

Applies the normalized TDS metadata model to user-defined type and XML schema metadata.

  • Renames SqlMetaDataUdt and SqlMetaDataXmlSchemaCollection to TdsUdtTypeInfo and TdsXmlTypeInfo.
  • Converts eligible fields to documented properties.
  • Replaces the bespoke CopyFrom pattern with conventional clone methods and copy constructors across UDT, XML, column, and general type metadata.
  • Updates parser, connection, reader, parameter, and column call sites.
  • Adds focused unit coverage for cloning the affected metadata types.

This is layer 3 of 3 in the TDS parser organization stack. It targets dev/russellben/tokens/tdstypeinfo (PR #4811), so review should focus on UDT/XML metadata and clone semantics.

Issues

Supersedes closed PR #4677. No linked issue; this is an internal naming and maintainability refactor.

Testing

Adds focused unit coverage for cloning the affected metadata types. No new test run was performed during PR submission.

Guidelines

Copilot AI balanced review requested due to automatic review settings October 9, 2026 16:19
@benrr101
benrr101 requested a review from a team as a code owner October 9, 2026 16:19
@github-project-automation github-project-automation Bot moved this to To triage in SqlClient Board Oct 9, 2026
@benrr101
benrr101 added this pull request to stack #4813 October 9, 2026 16:20

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 Changes recommended

Several added test declarations lack the repository-required behavior-focused XML summaries.

5 open findings
What changed in this PR

Normalizes internal UDT and XML TDS metadata naming and cloning while preserving parser and reader behavior.

Changes:

  • Introduces TdsUdtTypeInfo and TdsXmlTypeInfo.
  • Replaces CopyFrom with typed cloning and copy constructors.
  • Updates consumers and adds clone/default-value tests.

Required XML summaries remain missing from several new tests. CI is still running.

File Description
TdsXmlTypeInfoTests.cs Tests XML metadata cloning and defaults.
TdsUdtTypeInfoTests.cs Tests UDT metadata cloning and defaults.
TdsColumnMetadataTests.cs Tests column cloning and packed flags.
SqlParameter.cs Migrates XML metadata and cloning.
SqlDbColumn.cs Uses normalized UDT metadata.
SqlDataReader.cs Updates UDT/XML metadata access.
SqlConnection.cs Updates UDT type resolution.
TdsXmlTypeInfo.cs Adds normalized XML metadata type.
TdsUdtTypeInfo.cs Adds normalized UDT metadata type.
TdsTypeInfo.cs Adds copy construction and renamed properties.
TdsColumnMetadataToken.cs Uses typed column cloning.
TdsColumnMetadata.cs Adds typed copy construction.
SqlMetaDataXmlSchemaCollection.cs Removes legacy XML metadata type.
SqlMetaDataUdt.cs Removes legacy UDT metadata type.
TdsParser.cs Populates normalized metadata types.

🧠 Review effort: Balanced


💡 Configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Assert.Equal(original.XmlTypeInfo.Name, clone.XmlTypeInfo.Name);
}

[Fact]

namespace Microsoft.Data.SqlClient.Parser.Tokens;

public class TdsUdtTypeInfoTests

public class TdsUdtTypeInfoTests
{
[Fact]

namespace Microsoft.Data.SqlClient.Parser.Tokens;

public class TdsXmlTypeInfoTests

public class TdsXmlTypeInfoTests
{
[Fact]

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: To triage

Development

Successfully merging this pull request may close these issues.

4 participants