From ee3588df753bffe92a34254c456ea4a1c332309c Mon Sep 17 00:00:00 2001 From: Alan Ren Date: Mon, 4 Oct 2021 14:49:36 -0700 Subject: [PATCH] set issupportedVersion flag (#1255) --- .../Connection/ConnectionService.cs | 2 ++ .../Contracts/ConnectionCompleteNotification.cs | 10 ++++++++++ 2 files changed, 12 insertions(+) diff --git a/src/Microsoft.SqlTools.ServiceLayer/Connection/ConnectionService.cs b/src/Microsoft.SqlTools.ServiceLayer/Connection/ConnectionService.cs index 23284e29..6c30cda9 100644 --- a/src/Microsoft.SqlTools.ServiceLayer/Connection/ConnectionService.cs +++ b/src/Microsoft.SqlTools.ServiceLayer/Connection/ConnectionService.cs @@ -480,6 +480,8 @@ namespace Microsoft.SqlTools.ServiceLayer.Connection connectionInfo.IsSqlDb = serverInfo.EngineEditionId == (int)DatabaseEngineEdition.SqlDatabase; connectionInfo.IsSqlDW = (serverInfo.EngineEditionId == (int)DatabaseEngineEdition.SqlDataWarehouse); connectionInfo.EngineEdition = (DatabaseEngineEdition)serverInfo.EngineEditionId; + // Azure Data Studio supports SQL Server 2014 and later releases. + response.IsSupportedVersion = serverInfo.IsCloud || serverInfo.ServerMajorVersion >= 12; } catch (Exception ex) { diff --git a/src/Microsoft.SqlTools.ServiceLayer/Connection/Contracts/ConnectionCompleteNotification.cs b/src/Microsoft.SqlTools.ServiceLayer/Connection/Contracts/ConnectionCompleteNotification.cs index eee0cff8..2fea773b 100644 --- a/src/Microsoft.SqlTools.ServiceLayer/Connection/Contracts/ConnectionCompleteNotification.cs +++ b/src/Microsoft.SqlTools.ServiceLayer/Connection/Contracts/ConnectionCompleteNotification.cs @@ -52,6 +52,16 @@ namespace Microsoft.SqlTools.ServiceLayer.Connection.Contracts /// The type of connection that this notification is for /// public string Type { get; set; } = ConnectionType.Default; + + /// + /// Gets or sets a boolean value indicates whether the current server version is supported by the service. + /// + public bool IsSupportedVersion { get; set; } + + /// + /// Gets or sets the additional warning message about the unsupported server version. + /// + public string UnsupportedVersionMessage { get; set; } } ///