Fix MODEL_TYPE fragment classification in CreateExternalModelStatement#210
Merged
Merged
Conversation
ZEUSXXIV
requested review from
chlafreniere,
dzsquared,
kburtram,
llali and
ssreerama
as code owners
June 1, 2026 19:07
Contributor
Author
|
@microsoft-github-policy-service agree |
llali
approved these changes
Jun 4, 2026
llali
added a commit
that referenced
this pull request
Jul 22, 2026
Commit 20f9bf1 (PR #210, fixing #176) reclassified MODEL_TYPE as a TSqlFragment but broke the public API: it repurposed the enum ExternalModelTypeOption into a fragment class and changed the type of ExternalModelStatement.ModelType from ExternalModelTypeOption? to a fragment reference. This change delivers the same fix additively, without breaking the API: - Keep enum ExternalModelTypeOption { EMBEDDINGS } and the ExternalModelStatement.ModelType (ExternalModelTypeOption?) member unchanged for backward compatibility. - Add a visitable fragment ExternalModelTypeSpecification whose OptionKind reuses the existing ExternalModelTypeOption enum, plus a new ModelTypeSpecification member on ExternalModelStatement. - The parser populates both representations; the script generator prefers the fragment and falls back to the legacy enum. All 624 unit tests pass on net8.0 and net472.
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.
Description
Fixes #176.
Exposes
MODEL_TYPEas a proper subclass ofTSqlFragment(ExternalModelTypeOption) inCREATE EXTERNAL MODELandALTER EXTERNAL MODELstatements. This enables fragment visitation viaTSqlFragmentVisitor, tracks start offset and position metadata, and ensures architectural consistency. Includes regression coverage to verify visitor traversal.Code Changes