Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
53 changes: 50 additions & 3 deletions SqlScriptDom/Parser/TSql/Ast.xml
Original file line number Diff line number Diff line change
Expand Up @@ -403,8 +403,8 @@
Summary="Actual JSON for clause options. First one is always present (JSON mode)."/>
</Class>
<Class Name="JsonKeyValue" Base="ScalarExpression" Summary ="Represent a key value Pair">
<Member Name="JsonKeyName" Type="ScalarExpression" Summary="Key name" />
<Member Name="JsonValue" Type="ScalarExpression" Summary="scalar expression" />
<Member Name="JsonKeyName" Type="ScalarExpression" Summary="Key name" />
<Member Name="JsonValue" Type="ScalarExpression" Summary="scalar expression" />
</Class>
<Class Name="JsonForClauseOption" Base="ForClause" Summary="Represents FOR JSON (options) case">
<Member Name="OptionKind" Type="JsonForClauseOptions" GenerateUpdatePositionInfoCall="false" Summary="Option kind"/>
Expand Down Expand Up @@ -642,6 +642,7 @@
<Member Name="TrimOptions" Type="Identifier" Summary="TRIM intrinsic can take optional arguments like 'Leading', 'Trailing' or 'Both'."/>
<Member Name="JsonParameters" Type="JsonKeyValue" Collection="true" Summary="The Json parameters to the function."/>
<Member Name="AbsentOrNullOnNull" Type="Identifier" Collection="true" Summary="The Absent or Null on Null will convert or remove sql null to json null"/>
<Member Name="ReturnType" Type="Identifier" Collection="true" Summary="Return type of function. Used by json_arrayagg, json_objectagg, json_array, json_object and json_value"/>
</Class>
<Class Name="CallTarget" Abstract="true" Summary="Represents a target of a function call.">
</Class>
Expand Down Expand Up @@ -1346,6 +1347,27 @@
<InheritedClass Name="DropUnownedObjectStatement"/>
</Class>

<Class Name="ExternalModelStatement" Abstract="true" Base="TSqlStatement" Summary="Base class for all external model statement objects.">
<Member Name="Name" Type="Identifier" Summary="The external model name."/>
<Member Name="Location" Type="Literal" Summary="The external model location name."/>
<Member Name="ApiFormat" Type="Literal" Summary="The external model api format name."/>
<Member Name="ModelType" Type="ExternalModelTypeOption?" GenerateUpdatePositionInfoCall="false" Summary="The external model type name."/>
<Member Name="ModelName" Type="Literal" Summary="The external model name to be used to generate embeddings."/>
<Member Name="Credential" Type="Identifier" Summary="The external model credentials name."/>
<Member Name="Parameters" Type="Literal" Summary="The external model parameters as key-value pairs."/>
<Member Name="LocalRuntimePath" Type="Literal" Summary="The local runtime path for the model."/>
</Class>
<Class Name="CreateExternalModelStatement" Base="ExternalModelStatement" Summary="Represents a CREATE EXTERNAL MODEL statement.">
<InheritedClass Name="ExternalModelStatement"/>
<Implements Interface="IAuthorization"/>
</Class>
<Class Name="DropExternalModelStatement" Base="DropUnownedObjectStatement" Summary="Represents a DROP EXTERNAL MODEL statement.">
<InheritedClass Name="DropUnownedObjectStatement"/>
</Class>
<Class Name="AlterExternalModelStatement" Base="ExternalModelStatement" Summary="Represents a ALTER EXTERNAL MODEL statement.">
<InheritedClass Name="ExternalModelStatement"/>
</Class>

<Class Name="ExternalFileFormatStatement" Abstract="true" Base="TSqlStatement" Summary="Base class for all external file format statement objects.">
<Member Name="Name" Type="Identifier" Summary="The external file format name."/>
<Member Name="FormatType" Type="ExternalFileFormatType" GenerateUpdatePositionInfoCall="false" Summary="The external file format type name."/>
Expand Down Expand Up @@ -3558,7 +3580,7 @@
</Class>
<Class Name="TableReferenceWithAlias" Abstract="true" Base="TableReference" Summary="This represents a table reference that can have an alias.">
<Member Name="Alias" Type="Identifier" Summary="Optional table alias. May be null."/>
<Member Name="ForPath" Type="bool" Summary="Whether this table reference is marked as graph FOR PATH."/>
<Member Name="ForPath" Type="bool" Summary="Whether this table reference is marked as graph FOR PATH."/>
</Class>
<Class Name="TableReferenceWithAliasAndColumns" Abstract="true" Base="TableReferenceWithAlias" Summary="Represents a table reference that can specify column aliases.">
<InheritedClass Name="TableReferenceWithAlias" />
Expand Down Expand Up @@ -4713,4 +4735,29 @@
<InheritedClass Name="DatabaseOption" />
<Member Name="ElasticPoolName" Type="Identifier" Summary="The name of the elastic pool."/>
</Class>
<Class Name="AIGenerateChunksTableReference" Base="TableReferenceWithAlias" Summary="Represents the AI_GENERATE_CHUNKS table-valued function call.">
<InheritedClass Name="TableReferenceWithAlias" />
<Member Name="Source" Type="ScalarExpression" Summary="The expression representing the input text or column to chunk." />
<Member Name="ChunkType" Type="Identifier" Summary="The chunking strategy, such as FIXED." />
</Class>
<Class Name="AIGenerateFixedChunksTableReference" Base="AIGenerateChunksTableReference" Summary="Represents a fixed-chunk configuration of AI_GENERATE_CHUNKS.">
<InheritedClass Name="AIGenerateChunksTableReference" />
<Member Name="ChunkSize" Type="ScalarExpression" Summary="The size of each generated chunk." />
<Member Name="Overlap" Type="ScalarExpression" Summary="Optional percentage of overlap between chunks." />
<Member Name="EnableChunkSetId" Type="ScalarExpression" Summary="Optional flag to include a chunk_set_id column in the result." />
</Class>
<Class Name="AIGenerateEmbeddingsFunctionCall" Base="PrimaryExpression" Summary="Represents the ai_generate_embeddings built-in.">
<InheritedClass Name="PrimaryExpression" />
<Member Name="Input" Type="ScalarExpression" Summary="Input text to generate embeddings for." />
<Member Name="ModelName" Type="SchemaObjectName" Summary="Model name used in USE MODEL clause." />
<Member Name="OptionalParameters" Type="ScalarExpression" Summary="Optional PARAMETERS clause, must evaluate to JSON." />
</Class>
<Class Name="VectorSearchTableReference" Base="TableReferenceWithAlias" Summary="Represents the VECTOR_SEARCH table-valued function call.">
<InheritedClass Name="TableReferenceWithAlias" />
<Member Name="Table" Type="TableReferenceWithAlias" Summary="Table on which perform the search." />
<Member Name="Column" Type="ColumnReferenceExpression" Summary="The vector column in which search is performed." />
<Member Name="SimilarTo" Type="ScalarExpression" Summary="The vector used for search." />
<Member Name="Metric" Type="StringLiteral" Summary="The distance metric to use for the search." />
<Member Name="TopN" Type="IntegerLiteral" Summary="The maximum number of similar vectors that must be returned." />
</Class>
</Types>
26 changes: 22 additions & 4 deletions SqlScriptDom/Parser/TSql/CodeGenerationSupporter.cs
Original file line number Diff line number Diff line change
Expand Up @@ -99,6 +99,8 @@ internal static class CodeGenerationSupporter
internal const string Affinity = "AFFINITY";
internal const string After = "AFTER";
internal const string Aggregate = "AGGREGATE";
internal const string AiGenerateChunks = "AI_GENERATE_CHUNKS";
internal const string AIGenerateEmbeddings = "AI_GENERATE_EMBEDDINGS";
internal const string Algorithm = "ALGORITHM";
internal const string AlterColumn = "ALTERCOLUMN";
internal const string All = "ALL";
Expand All @@ -118,6 +120,7 @@ internal static class CodeGenerationSupporter
internal const string Always = "ALWAYS";
internal const string Anonymous = "ANONYMOUS";
internal const string AnsiNullDefault = "ANSI_NULL_DEFAULT";
internal const string ApiFormat = "API_FORMAT";
internal const string Application = "APPLICATION";
internal const string ApplicationLog = "APPLICATION_LOG";
internal const string Apply = "APPLY";
Expand Down Expand Up @@ -198,6 +201,8 @@ internal static class CodeGenerationSupporter
internal const string CheckPolicy = "CHECK_POLICY";
internal const string Checksum = "CHECKSUM";
internal const string ChecksumAgg = "CHECKSUM_AGG";
internal const string ChunkSize = "CHUNK_SIZE";
internal const string ChunkType = "CHUNK_TYPE";
internal const string ModularSum = "MODULAR_SUM";
internal const string Classifier = "CLASSIFIER";
internal const string Classification = "CLASSIFICATION";
Expand Down Expand Up @@ -225,7 +230,6 @@ internal static class CodeGenerationSupporter
internal const string CompressionDelay = "COMPRESSION_DELAY";
internal const string CompressAllRowGroups = "COMPRESS_ALL_ROW_GROUPS";
internal const string Concat = "CONCAT";
internal const string Cosine = "COSINE";
internal const string Configuration = "CONFIGURATION";
internal const string ConnectionOptions = "CONNECTION_OPTIONS";
internal const string Contained = "CONTAINED";
Expand All @@ -244,6 +248,7 @@ internal static class CodeGenerationSupporter
internal const string CopyCommand = "COPY";
internal const string CopyOnly = "COPY_ONLY";
internal const string Correlated = "CORRELATED";
internal const string Cosine = "COSINE";
internal const string Count = "COUNT";
internal const string CountBig = "COUNT_BIG";
internal const string Counter = "COUNTER";
Expand Down Expand Up @@ -301,7 +306,6 @@ internal static class CodeGenerationSupporter
internal const string Description = "DESCRIPTION";
internal const string DesiredState = "DESIRED_STATE";
internal const string DiskANN = "DISKANN";
internal const string Dot = "DOT";
internal const string Delay = "DELAY";
internal const string DelayedDurability = "DELAYED_DURABILITY";
internal const string DelimitedText = "DELIMITEDTEXT";
Expand All @@ -320,6 +324,7 @@ internal static class CodeGenerationSupporter
internal const string Document = "DOCUMENT";
internal const string DollarSign = "$";
internal const string DollarPartition = "$PARTITION";
internal const string Dot = "DOT";
internal const string Drop = "DROP";
internal const string DropExisting = "DROP_EXISTING";
internal const string DTSBuffers = "DTS_BUFFERS";
Expand All @@ -329,11 +334,13 @@ internal static class CodeGenerationSupporter
internal const string Edition = "EDITION";
internal const string ElasticPool = "ELASTIC_POOL";
internal const string Elements = "ELEMENTS";
internal const string Embeddings = "EMBEDDINGS";
internal const string Emergency = "EMERGENCY";
internal const string Empty = "EMPTY";
internal const string Enable = "ENABLE";
internal const string Enabled = "ENABLED";
internal const string EnableBroker = "ENABLE_BROKER";
internal const string EnableChunkSetId = "ENABLE_CHUNK_SET_ID";
internal const string EnclaveComputations = "ENCLAVE_COMPUTATIONS";
internal const string Encoding = "ENCODING";
internal const string Encrypted = "ENCRYPTED";
Expand All @@ -350,13 +357,13 @@ internal static class CodeGenerationSupporter
internal const string EnvironmentVariables = "ENVIRONMENT_VARIABLES";
internal const string Equal = "=";
internal const string Error = "ERROR";
internal const string Euclidean = "EUCLIDEAN";
internal const string ErrorBrokerConversations = "ERROR_BROKER_CONVERSATIONS";
internal const string ErrorDataSource = "ERRORFILE_DATA_SOURCE";
internal const string ErrorFile = "ERRORFILE";
internal const string ErrorFileCredential = "ERRORFILE_CREDENTIAL";
internal const string EscapeChar = "ESCAPECHAR";
internal const string EstimateOnly = "ESTIMATEONLY";
internal const string Euclidean = "EUCLIDEAN";
internal const string Event = "EVENT";
internal const string EventRetentionMode = "EVENT_RETENTION_MODE";
internal const string Exclamation = "!";
Expand Down Expand Up @@ -415,6 +422,7 @@ internal static class CodeGenerationSupporter
internal const string FieldQuote = "FIELDQUOTE";
internal const string FipsFlagger = "FIPS_FLAGGER";
internal const string First = "FIRST";
internal const string Fixed = "FIXED";
internal const string FlushIntervalSeconds = "FLUSH_INTERVAL_SECONDS";
internal const string FlushIntervalSecondsAlt = "DATA_FLUSH_INTERVAL_SECONDS";
internal const string Fn = "FN";
Expand Down Expand Up @@ -514,6 +522,7 @@ internal static class CodeGenerationSupporter
internal const string Json = "JSON";
internal const string JsonArray = "JSON_ARRAY";
internal const string JsonObject = "JSON_OBJECT";
internal const string JsonObjectAgg = "JSON_OBJECTAGG";
internal const string Keep = "KEEP";
internal const string KeepDefaults = "KEEPDEFAULTS";
internal const string KeepFixed = "KEEPFIXED";
Expand Down Expand Up @@ -555,6 +564,7 @@ internal static class CodeGenerationSupporter
internal const string LoadHistory = "LOADHISTORY";
internal const string LobCompaction = "LOB_COMPACTION";
internal const string Local = "LOCAL";
internal const string LocalRuntimePath = "LOCAL_RUNTIME_PATH";
internal const string Location = "LOCATION";
internal const string LocationUserDB = "USER_DB";
internal const string LocalServiceName = "LOCAL_SERVICE_NAME";
Expand Down Expand Up @@ -615,8 +625,8 @@ internal static class CodeGenerationSupporter
internal const string Message = "MESSAGE";
internal const string MessageForwarding = "MESSAGE_FORWARDING";
internal const string MessageForwardSize = "MESSAGE_FORWARD_SIZE";
internal const string MigrationState = "MIGRATION_STATE";
internal const string Metric = "METRIC";
internal const string MigrationState = "MIGRATION_STATE";
internal const string Min = "MIN";
internal const string MinGrantPercent = "MIN_GRANT_PERCENT";
internal const string MinCpuPercent = "MIN_CPU_PERCENT";
Expand All @@ -628,6 +638,8 @@ internal static class CodeGenerationSupporter
internal const string Mirror = "MIRROR";
internal const string Mixed = "MIXED";
internal const string MixedPageAllocation = "MIXED_PAGE_ALLOCATION";
internal const string ModelType = "MODEL_TYPE";
internal const string ModelName = "MODEL";
internal const string Modify = "MODIFY";
internal const string Money = "MONEY";
internal const string Move = "MOVE";
Expand Down Expand Up @@ -761,6 +773,7 @@ internal static class CodeGenerationSupporter
internal const string Model = "MODEL";
internal const string RunTime = "RUNTIME";
internal const string Onnx = "ONNX";
internal const string Overlap = "OVERLAP";

internal const string Process = "PROCESS";
internal const string PropertySetGuid = "PROPERTY_SET_GUID";
Expand Down Expand Up @@ -842,6 +855,7 @@ internal static class CodeGenerationSupporter
internal const string RetentionDays = "RETENTION_DAYS";
internal const string RetentionPeriod = "RETENTION_PERIOD";
internal const string Returns = "RETURNS";
internal const string Returning = "RETURNING";
internal const string RequestMaxCpuTimeSec = "REQUEST_MAX_CPU_TIME_SEC";
internal const string RequestMaxMemoryGrantPercent = "REQUEST_MAX_MEMORY_GRANT_PERCENT";
internal const string RequestMemoryGrantTimeoutSec = "REQUEST_MEMORY_GRANT_TIMEOUT_SEC";
Expand Down Expand Up @@ -916,6 +930,7 @@ internal static class CodeGenerationSupporter
internal const string ShrinkDb = "SHRINKDB";
internal const string Sid = "SID";
internal const string Signature = "SIGNATURE";
internal const string SimilarTo = "SIMILAR_TO";
internal const string Simple = "SIMPLE";
internal const string SingleBlob = "SINGLE_BLOB";
internal const string SingleClob = "SINGLE_CLOB";
Expand Down Expand Up @@ -1025,6 +1040,7 @@ internal static class CodeGenerationSupporter
internal const string Timer = "TIMER";
internal const string TimeStamp = "TIMESTAMP";
internal const string TinyInt = "TINYINT";
internal const string TopN = "TOP_N";
internal const string TornPageDetection = "TORN_PAGE_DETECTION";
internal const string TrackCausality = "TRACK_CAUSALITY";
internal const string TrackColumnsUpdated = "TRACK_COLUMNS_UPDATED";
Expand Down Expand Up @@ -1059,6 +1075,7 @@ internal static class CodeGenerationSupporter
internal const string Unpivot = "UNPIVOT";
internal const string UpdLock = "UPDLOCK";
internal const string Url = "URL";
internal const string Use = "USE";
internal const string Used = "USED";
internal const string UseIdentity = "USE_IDENTITY";
internal const string UseTypeDefault = "USE_TYPE_DEFAULT";
Expand All @@ -1076,6 +1093,7 @@ internal static class CodeGenerationSupporter
internal const string Varp = "VARP";
internal const string VDevNo = "VDEVNO";
internal const string Vector = "Vector";
internal const string VectorSearch = "VECTOR_SEARCH";
internal const string Verbose = "VERBOSE";
internal const string VerboseLogging = "VerboseLogging";
internal const string VerifyOnly = "VERIFYONLY";
Expand Down
26 changes: 26 additions & 0 deletions SqlScriptDom/Parser/TSql/ExternalModelTypeOption.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
//------------------------------------------------------------------------------
// <copyright file="ExternalModelTypeOption.cs" company="Microsoft">
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
//------------------------------------------------------------------------------
using System;

namespace Microsoft.SqlServer.TransactSql.ScriptDom
{
#pragma warning disable 1591

/// <summary>
/// The enumeration specifies the external model type
/// Currently, we support EMBEDDINGS only.
/// </summary>
public enum ExternalModelTypeOption
{
/// <summary>
/// MODEL_TYPE = EMBEDDINGS
/// </summary>
EMBEDDINGS = 0,

}

#pragma warning restore 1591
}
1 change: 1 addition & 0 deletions SqlScriptDom/Parser/TSql/SecurityObjectKind.cs
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@ public enum SecurityObjectKind
SearchPropertyList = 23,
ServerRole = 24,
AvailabilityGroup = 25,
ExternalModel = 26,
}

#pragma warning restore 1591
Expand Down
Loading
Loading