SqlScriptDOM icon indicating copy to clipboard operation
SqlScriptDOM copied to clipboard

`MODEL_TYPE` not classified as `TSqlFragment` in `CreateExternalModelStatement`

Open naveennaik1 opened this issue 3 months ago โ€ข 0 comments

Description

While using the Microsoft ScriptDom parser, I observed an inconsistency in the classification of properties within the CreateExternalModelStatement class.

Most properties are correctly identified as TSqlFragment types, including:

  • Location
  • ModelName
  • ApiFormat
  • LocalRuntimePath
  • Credential
  • Parameters

However, the MODEL_TYPE field is not classified as a TSqlFragment, which breaks consistency and complicates tooling that relies on uniform fragment types for parsing and analysis.


๐Ÿ” Expected Behavior

MODEL_TYPE should be exposed as a TSqlFragment, just like the other fields in CreateExternalModelStatement.


โŒ Actual Behavior

MODEL_TYPE is not treated as a TSqlFragment, making it harder to traverse or extract metadata consistently across all fields.


๐Ÿงช Steps to Reproduce

  1. Parse a CREATE EXTERNAL MODEL statement using ScriptDom.
  2. Inspect the resulting CreateExternalModelStatement object.
  3. Observe that MODEL_TYPE is not a TSqlFragment.

โœ… Suggested Fix

Update the parser to classify MODEL_TYPE as a TSqlFragment for consistency and better support in downstream tooling.


๐Ÿ“Ž Additional Context

This change would improve the usability of ScriptDom for scenarios involving AST traversal, formatting, and metadata extraction.

naveennaik1 avatar Oct 22 '25 10:10 naveennaik1