Skip to content

GetSchema("DataTypes") does not return entries for JSON and VECTOR types #3833

Description

@igor-tkachev

Describe the bug

SqlConnection.GetSchema("DataTypes") does not include rows for the built-in SQL Server types JSON and VECTOR.

To reproduce

using Microsoft.Data.SqlClient;

using var connection = new SqlConnection("Server=.;Database=master;Integrated Security=true;");
connection.Open();

var table = connection.GetSchema("DataTypes");

bool hasJson   = table.Rows.Cast<DataRow>().Any(r => ((string)r["TypeName"]).Equals("json",   StringComparison.OrdinalIgnoreCase));
bool hasVector = table.Rows.Cast<DataRow>().Any(r => ((string)r["TypeName"]).Equals("vector", StringComparison.OrdinalIgnoreCase));

Console.WriteLine($"JSON found:   {hasJson}");
Console.WriteLine($"VECTOR found: {hasVector}");

Actual: both return false
Expected: both types should be included

Further technical details

Microsoft.Data.SqlClient version: all versions, including prerelease
.NET target: all
SQL Server version: SQL Server 2025
Operating system: any

Activity

  1. added theissue type on Dec 8, 2025
  2. moved this from To triage to No status in SqlClient Boardon Dec 8, 2025
  3. changed the issue type fromtoon Dec 8, 2025
  4. moved this to Backlog in SqlClient Boardon Dec 8, 2025
  5. moved this from Backlog to Investigating in SqlClient Boardon Dec 8, 2025
  6. mdaigle commented on Dec 8, 2025

    @mdaigle
    Contributor

    cc @apoorvdeshmukh this looks like another vector enhancement

  7. igor-tkachev commented on Dec 8, 2025

    @igor-tkachev
    Author

    Just to clarify, this isn’t only a vector-specific enhancement.

    When new types are added to the provider, their metadata also needs to appear in GetSchema("DataTypes"), because many tools that work with database metadata, both at runtime and for code generation, rely on this information.

    Since JSON and VECTOR are missing from the metadata, this is mostly about keeping provider type metadata in sync with newly supported types.

    Thanks!

  8. moved this from Investigating to Backlog in SqlClient Boardon Dec 9, 2025
  9. mdaigle commented on Dec 9, 2025

    @mdaigle
    Contributor

    Thanks @igor-tkachev, we have prioritized it accordingly and will try to pick up the work soon.

  10. moved this from Backlog to In progress in SqlClient Boardon Dec 28, 2025
  11. added this to the 7.1.0-preview1 milestone on Feb 17, 2026
  12. removed this from the 7.1.0-preview1 milestone on Apr 24, 2026
  13. priyankatiwari08 commented on Sep 17, 2026

    @priyankatiwari08
    Contributor

    /triage

  14. github-actions commented on Sep 17, 2026

    @github-actions

    🔍 Triage Summary (on-demand re-triage)

    Check Result
    Issue type Feature
    Environment All required environment details provided for investigation
    Area Area\Vector
    Duplicates Related (not duplicate): #4592 (closed, JSON-only fix merged in #4682)
    Regression Not indicated — this is a metadata coverage gap, not a regression

    Analysis

    SqlConnection.GetSchema("DataTypes") is missing rows for both the json and vector SQL Server 2025 types. The json half of this gap has already been addressed: #4592 was fixed by PR #4682, which switches the json row's inclusion check from a raw server-version string comparison (SqlMetaDataFactory.SupportedByCurrentVersion) to the negotiated ConnectionCapabilities.JsonType feature flag, so json should now correctly appear when the server advertises support (including Azure SQL). However, SqlMetaDataFactory.DataTypes.cs still has no row/branch for vector at all — unlike json, there is no AddVectorType-style conditional entry gated on a negotiated vector-support capability. This is a P2 metadata-completeness gap: it doesn't break core functionality, but it affects any tool or ORM that discovers supported types via GetSchema("DataTypes"), including code-generation and schema-introspection scenarios noted by the reporter.

    Next Steps

    • Verify the current state of the json fix (PR Fix | GetSchema("DataTypes") does not report json type on Azure SQL (… #4682, merged 2026-09-14) resolves the json portion of this issue in the next release; if so, this issue's scope narrows to vector only.
    • Assign to Copilot coding agent to add a vector row to SqlMetaDataFactory.DataTypes.cs, following the same pattern used for json: gate inclusion on a negotiated vector-support signal (e.g. an equivalent of ConnectionCapabilities.JsonType, mirroring TdsEnums.VECTOR_VERSION_NOT_SUPPORTED checks used elsewhere in the vector feature work) rather than a raw server version string comparison, so it works correctly against both on-prem SQL Server 2025 and any future Azure SQL vector support.
    • Add/extend DataTypes schema tests (functional or manual) asserting both json and vector rows appear when the server capability is negotiated, and are absent otherwise.
    • Update the public ref/ DataTypes documentation/samples if the row's metadata (e.g. IsBestMatch, literal prefixes) needs adjustment for vector.

    Note: This triage summary is auto-generated by an AI agent. The analysis and suggestions above have not been verified by a human maintainer. Please treat as preliminary guidance only.

    Generated by SqlClient Issue Auto-Triage for #3833 · copilot · auto · 84 AIC · ⌖ 13.1 AIC · ⊞ 11.9K · ◷

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

Metadata

Metadata

Labels

No labels
No labels

Projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions