mirror of
https://github.com/ckaczor/sqltoolsservice.git
synced 2026-02-17 02:51:45 -05:00
[brgrbic] SqlOD changes for cloud Server Type and minor bug fixes (#1092)
* The ServerType of SQL OD in SMO is being changed to cloud. This is a minimal set of changes needed in sqltoolservice in order to keep everything working within ADS. * SMO version update
This commit is contained in:
committed by
GitHub
parent
dbfcf4ad61
commit
3e98a2f17b
@@ -18,7 +18,7 @@
|
|||||||
|
|
||||||
<PackageReference Update="Microsoft.Data.SqlClient.AlwaysEncrypted.AzureKeyVaultProvider" Version="1.1.1" />
|
<PackageReference Update="Microsoft.Data.SqlClient.AlwaysEncrypted.AzureKeyVaultProvider" Version="1.1.1" />
|
||||||
<PackageReference Update="Microsoft.Data.SqlClient" Version="2.0.0"/>
|
<PackageReference Update="Microsoft.Data.SqlClient" Version="2.0.0"/>
|
||||||
<PackageReference Update="Microsoft.SqlServer.SqlManagementObjects" Version="160.2004021.0" />
|
<PackageReference Update="Microsoft.SqlServer.SqlManagementObjects" Version="161.44091.28" />
|
||||||
<PackageReference Update="Microsoft.SqlServer.DACFx" Version="150.4926.2-preview" GeneratePathProperty="true" />
|
<PackageReference Update="Microsoft.SqlServer.DACFx" Version="150.4926.2-preview" GeneratePathProperty="true" />
|
||||||
<PackageReference Update="Microsoft.Azure.Kusto.Data" Version="8.0.2" />
|
<PackageReference Update="Microsoft.Azure.Kusto.Data" Version="8.0.2" />
|
||||||
<PackageReference Update="Microsoft.Azure.Kusto.Language" Version="8.1.2"/>
|
<PackageReference Update="Microsoft.Azure.Kusto.Language" Version="8.1.2"/>
|
||||||
|
|||||||
@@ -39,6 +39,7 @@ namespace Microsoft.SqlTools.CoreServices.Connection.ReliableConnection
|
|||||||
(int)DatabaseEngineEdition.SqlDatabase,
|
(int)DatabaseEngineEdition.SqlDatabase,
|
||||||
(int)DatabaseEngineEdition.SqlDataWarehouse,
|
(int)DatabaseEngineEdition.SqlDataWarehouse,
|
||||||
(int)DatabaseEngineEdition.SqlStretchDatabase,
|
(int)DatabaseEngineEdition.SqlStretchDatabase,
|
||||||
|
(int)DatabaseEngineEdition.SqlOnDemand,
|
||||||
// Note: for now, ignoring managed instance as it should be treated just like on prem.
|
// Note: for now, ignoring managed instance as it should be treated just like on prem.
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|||||||
@@ -39,6 +39,7 @@ namespace Microsoft.SqlTools.ServiceLayer.Connection.ReliableConnection
|
|||||||
(int)DatabaseEngineEdition.SqlDatabase,
|
(int)DatabaseEngineEdition.SqlDatabase,
|
||||||
(int)DatabaseEngineEdition.SqlDataWarehouse,
|
(int)DatabaseEngineEdition.SqlDataWarehouse,
|
||||||
(int)DatabaseEngineEdition.SqlStretchDatabase,
|
(int)DatabaseEngineEdition.SqlStretchDatabase,
|
||||||
|
(int)DatabaseEngineEdition.SqlOnDemand,
|
||||||
// Note: for now, ignoring managed instance as it should be treated just like on prem.
|
// Note: for now, ignoring managed instance as it should be treated just like on prem.
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|||||||
@@ -280,7 +280,7 @@ namespace Microsoft.SqlTools.ServiceLayer.Admin
|
|||||||
SELECT so.name as configured_slo_name, so2.name as current_slo_name
|
SELECT so.name as configured_slo_name, so2.name as current_slo_name
|
||||||
FROM dbo.slo_database_objectives do
|
FROM dbo.slo_database_objectives do
|
||||||
INNER JOIN dbo.slo_service_objectives so ON do.configured_objective_id = so.objective_id
|
INNER JOIN dbo.slo_service_objectives so ON do.configured_objective_id = so.objective_id
|
||||||
INNER JOIN dbo.slo_service_objectives so2 ON do.current_objective_id = so2.objective_id
|
INNER JOIN dbo.slo_service_objectives so2 ON do.current_objective_id = so2.objective_id
|
||||||
WHERE do.database_id = @DbID
|
WHERE do.database_id = @DbID
|
||||||
";
|
";
|
||||||
|
|
||||||
@@ -586,7 +586,8 @@ WHERE do.database_id = @DbID
|
|||||||
}
|
}
|
||||||
|
|
||||||
//Only fill in the Azure properties when connected to an Azure server
|
//Only fill in the Azure properties when connected to an Azure server
|
||||||
if (context.Server.ServerType == DatabaseEngineType.SqlAzureDatabase)
|
if (context.Server.ServerType == DatabaseEngineType.SqlAzureDatabase
|
||||||
|
&& context.Server.DatabaseEngineEdition != DatabaseEngineEdition.SqlOnDemand)
|
||||||
{
|
{
|
||||||
this.azureEditionDisplayValue = db.AzureEdition;
|
this.azureEditionDisplayValue = db.AzureEdition;
|
||||||
AzureEdition edition;
|
AzureEdition edition;
|
||||||
|
|||||||
@@ -7,6 +7,7 @@ using System;
|
|||||||
using System.Collections.Concurrent;
|
using System.Collections.Concurrent;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using System.Data.Common;
|
using System.Data.Common;
|
||||||
|
using Microsoft.SqlServer.Management.Common;
|
||||||
using Microsoft.SqlTools.ServiceLayer.Connection.Contracts;
|
using Microsoft.SqlTools.ServiceLayer.Connection.Contracts;
|
||||||
using Microsoft.SqlTools.Utility;
|
using Microsoft.SqlTools.Utility;
|
||||||
|
|
||||||
@@ -76,6 +77,11 @@ namespace Microsoft.SqlTools.ServiceLayer.Connection
|
|||||||
/// </summary>
|
/// </summary>
|
||||||
public bool IsSqlDW { get; set; }
|
public bool IsSqlDW { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Returns the connection Engine Edition
|
||||||
|
/// </summary>
|
||||||
|
public DatabaseEngineEdition EngineEdition { get; set; }
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Returns the major version number of the db we are connected to
|
/// Returns the major version number of the db we are connected to
|
||||||
/// </summary>
|
/// </summary>
|
||||||
|
|||||||
@@ -472,6 +472,7 @@ namespace Microsoft.SqlTools.ServiceLayer.Connection
|
|||||||
connectionInfo.MajorVersion = serverInfo.ServerMajorVersion;
|
connectionInfo.MajorVersion = serverInfo.ServerMajorVersion;
|
||||||
connectionInfo.IsSqlDb = serverInfo.EngineEditionId == (int)DatabaseEngineEdition.SqlDatabase;
|
connectionInfo.IsSqlDb = serverInfo.EngineEditionId == (int)DatabaseEngineEdition.SqlDatabase;
|
||||||
connectionInfo.IsSqlDW = (serverInfo.EngineEditionId == (int)DatabaseEngineEdition.SqlDataWarehouse);
|
connectionInfo.IsSqlDW = (serverInfo.EngineEditionId == (int)DatabaseEngineEdition.SqlDataWarehouse);
|
||||||
|
connectionInfo.EngineEdition = (DatabaseEngineEdition) serverInfo.EngineEditionId;
|
||||||
}
|
}
|
||||||
catch (Exception ex)
|
catch (Exception ex)
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -7,6 +7,7 @@ using System.Collections.Generic;
|
|||||||
using System.Data;
|
using System.Data;
|
||||||
using System.Data.Common;
|
using System.Data.Common;
|
||||||
using System.Linq;
|
using System.Linq;
|
||||||
|
using Microsoft.SqlServer.Management.Common;
|
||||||
using Microsoft.SqlTools.ServiceLayer.Admin.Contracts;
|
using Microsoft.SqlTools.ServiceLayer.Admin.Contracts;
|
||||||
using Microsoft.SqlTools.ServiceLayer.Connection.Contracts;
|
using Microsoft.SqlTools.ServiceLayer.Connection.Contracts;
|
||||||
|
|
||||||
@@ -25,9 +26,9 @@ namespace Microsoft.SqlTools.ServiceLayer.Connection
|
|||||||
/// </summary>
|
/// </summary>
|
||||||
static class ListDatabaseRequestHandlerFactory
|
static class ListDatabaseRequestHandlerFactory
|
||||||
{
|
{
|
||||||
public static IListDatabaseRequestHandler getHandler(bool includeDetails, bool isSqlDB)
|
public static IListDatabaseRequestHandler getHandler(bool includeDetails, bool isSqlDB, ConnectionInfo connectionInfo = null)
|
||||||
{
|
{
|
||||||
if (!includeDetails)
|
if (!includeDetails || connectionInfo?.EngineEdition == DatabaseEngineEdition.SqlOnDemand)
|
||||||
{
|
{
|
||||||
return new DatabaseNamesHandler();
|
return new DatabaseNamesHandler();
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -265,7 +265,7 @@ namespace Microsoft.SqlTools.ServiceLayer.ObjectExplorer.SmoModel
|
|||||||
NodeType = "Folder",
|
NodeType = "Folder",
|
||||||
NodeTypeId = NodeTypes.ServerLevelServerRoles,
|
NodeTypeId = NodeTypes.ServerLevelServerRoles,
|
||||||
IsSystemObject = false,
|
IsSystemObject = false,
|
||||||
ValidFor = ValidForFlag.AllOnPrem|ValidForFlag.SqlOnDemand,
|
ValidFor = ValidForFlag.AllOnPrem,
|
||||||
SortPriority = SmoTreeNode.NextSortPriority,
|
SortPriority = SmoTreeNode.NextSortPriority,
|
||||||
});
|
});
|
||||||
currentChildren.Add(new FolderNode {
|
currentChildren.Add(new FolderNode {
|
||||||
|
|||||||
Reference in New Issue
Block a user