mirror of
https://github.com/ckaczor/sqltoolsservice.git
synced 2026-02-17 02:51:45 -05:00
Fix numerous Azure property issues (#511)
* Avoid crashing if azure edition is System. * Add new Azure-specific options to the prototype and return through the service calls * Send azure properties over database info request * IsCloud should include Azure SQL DW - Fixed references to this feature flag - Updated edition handling to include ManagedInstance and removed AzureV1 check since it's never used and it's been retired.
This commit is contained in:
committed by
Karl Burtram
parent
49f0221dc8
commit
d222af7824
@@ -46,6 +46,8 @@ namespace Microsoft.SqlTools.ServiceLayer.Admin
|
|||||||
internal const string FileGroup = "fileGroup";
|
internal const string FileGroup = "fileGroup";
|
||||||
internal const string InitialSize = "initialSize";
|
internal const string InitialSize = "initialSize";
|
||||||
internal const string IsPrimaryFile = "isPrimaryFile";
|
internal const string IsPrimaryFile = "isPrimaryFile";
|
||||||
|
internal const string AzureEdition = "azureEdition";
|
||||||
|
internal const string ServiceLevelObjective = "serviceLevelObjective";
|
||||||
|
|
||||||
|
|
||||||
internal static AdminServicesProviderOptions BuildAdminServicesProviderOptions()
|
internal static AdminServicesProviderOptions BuildAdminServicesProviderOptions()
|
||||||
|
|||||||
@@ -47,6 +47,7 @@ namespace Microsoft.SqlTools.ServiceLayer.Admin
|
|||||||
public ContainmentType databaseContainmentType;
|
public ContainmentType databaseContainmentType;
|
||||||
public PageVerify pageVerify;
|
public PageVerify pageVerify;
|
||||||
public AzureEdition azureEdition;
|
public AzureEdition azureEdition;
|
||||||
|
public string azureEditionDisplayValue;
|
||||||
public string configuredServiceLevelObjective;
|
public string configuredServiceLevelObjective;
|
||||||
public string currentServiceLevelObjective;
|
public string currentServiceLevelObjective;
|
||||||
public DbSize maxSize;
|
public DbSize maxSize;
|
||||||
@@ -151,6 +152,7 @@ namespace Microsoft.SqlTools.ServiceLayer.Admin
|
|||||||
this.filestreamDirectoryName = String.Empty;
|
this.filestreamDirectoryName = String.Empty;
|
||||||
this.delayedDurability = DelayedDurability.Disabled;
|
this.delayedDurability = DelayedDurability.Disabled;
|
||||||
this.azureEdition = AzureEdition.Standard;
|
this.azureEdition = AzureEdition.Standard;
|
||||||
|
this.azureEditionDisplayValue = AzureEdition.Standard.ToString();
|
||||||
this.configuredServiceLevelObjective = String.Empty;
|
this.configuredServiceLevelObjective = String.Empty;
|
||||||
this.currentServiceLevelObjective = String.Empty;
|
this.currentServiceLevelObjective = String.Empty;
|
||||||
this.maxSize = new DbSize(0, DbSize.SizeUnits.MB);
|
this.maxSize = new DbSize(0, DbSize.SizeUnits.MB);
|
||||||
@@ -264,6 +266,7 @@ namespace Microsoft.SqlTools.ServiceLayer.Admin
|
|||||||
if (context.Server.ServerType == DatabaseEngineType.SqlAzureDatabase)
|
if (context.Server.ServerType == DatabaseEngineType.SqlAzureDatabase)
|
||||||
{ //These properties are only available for Azure DBs
|
{ //These properties are only available for Azure DBs
|
||||||
this.azureEdition = AzureEdition.Standard;
|
this.azureEdition = AzureEdition.Standard;
|
||||||
|
this.azureEditionDisplayValue = azureEdition.ToString();
|
||||||
this.currentServiceLevelObjective = AzureSqlDbHelper.GetDefaultServiceObjective(this.azureEdition);
|
this.currentServiceLevelObjective = AzureSqlDbHelper.GetDefaultServiceObjective(this.azureEdition);
|
||||||
this.configuredServiceLevelObjective = AzureSqlDbHelper.GetDefaultServiceObjective(this.azureEdition);
|
this.configuredServiceLevelObjective = AzureSqlDbHelper.GetDefaultServiceObjective(this.azureEdition);
|
||||||
this.maxSize = AzureSqlDbHelper.GetDatabaseDefaultSize(this.azureEdition);
|
this.maxSize = AzureSqlDbHelper.GetDatabaseDefaultSize(this.azureEdition);
|
||||||
@@ -585,6 +588,7 @@ 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)
|
||||||
{
|
{
|
||||||
|
this.azureEditionDisplayValue = db.AzureEdition;
|
||||||
AzureEdition edition;
|
AzureEdition edition;
|
||||||
if (Enum.TryParse(db.AzureEdition, true, out edition))
|
if (Enum.TryParse(db.AzureEdition, true, out edition))
|
||||||
{
|
{
|
||||||
@@ -592,8 +596,8 @@ WHERE do.database_id = @DbID
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
//Unknown Azure DB Edition so we can't continue
|
// Unknown Azure DB Edition so we can't set a value, leave as default Standard
|
||||||
throw new Exception("CreateDatabaseOptionsSR.Error_UnknownAzureEdition(db.AzureEdition)");
|
// Note that this is likely a
|
||||||
}
|
}
|
||||||
|
|
||||||
//Size is in MB, but if it's greater than a GB we want to display the size in GB
|
//Size is in MB, but if it's greater than a GB we want to display the size in GB
|
||||||
@@ -725,6 +729,7 @@ WHERE do.database_id = @DbID
|
|||||||
this.targetRecoveryTime = other.targetRecoveryTime;
|
this.targetRecoveryTime = other.targetRecoveryTime;
|
||||||
this.delayedDurability = other.delayedDurability;
|
this.delayedDurability = other.delayedDurability;
|
||||||
this.azureEdition = other.azureEdition;
|
this.azureEdition = other.azureEdition;
|
||||||
|
this.azureEditionDisplayValue = other.azureEditionDisplayValue;
|
||||||
this.configuredServiceLevelObjective = other.configuredServiceLevelObjective;
|
this.configuredServiceLevelObjective = other.configuredServiceLevelObjective;
|
||||||
this.currentServiceLevelObjective = other.currentServiceLevelObjective;
|
this.currentServiceLevelObjective = other.currentServiceLevelObjective;
|
||||||
this.legacyCardinalityEstimation = other.legacyCardinalityEstimation;
|
this.legacyCardinalityEstimation = other.legacyCardinalityEstimation;
|
||||||
@@ -1915,7 +1920,7 @@ WHERE do.database_id = @DbID
|
|||||||
if (!FileNameHelper.IsValidFilename(this.FilestreamDirectoryName))
|
if (!FileNameHelper.IsValidFilename(this.FilestreamDirectoryName))
|
||||||
{
|
{
|
||||||
string message = String.Format(System.Globalization.CultureInfo.InvariantCulture,
|
string message = String.Format(System.Globalization.CultureInfo.InvariantCulture,
|
||||||
"CreateDatabaseOptionsSR.Error_InvalidDirectoryName {0}",
|
SR.Error_InvalidDirectoryName,
|
||||||
this.FilestreamDirectoryName);
|
this.FilestreamDirectoryName);
|
||||||
throw new ArgumentException(message);
|
throw new ArgumentException(message);
|
||||||
}
|
}
|
||||||
@@ -1940,7 +1945,7 @@ WHERE do.database_id = @DbID
|
|||||||
if (rowCount != 0)
|
if (rowCount != 0)
|
||||||
{
|
{
|
||||||
string message = String.Format(System.Globalization.CultureInfo.InvariantCulture,
|
string message = String.Format(System.Globalization.CultureInfo.InvariantCulture,
|
||||||
"CreateDatabaseOptionsSR.Error_ExistingDirectoryName {0} {1}",
|
SR.Error_ExistingDirectoryName,
|
||||||
this.FilestreamDirectoryName, this.Name);
|
this.FilestreamDirectoryName, this.Name);
|
||||||
throw new ArgumentException(message);
|
throw new ArgumentException(message);
|
||||||
|
|
||||||
|
|||||||
@@ -3,18 +3,15 @@
|
|||||||
// Licensed under the MIT license. See LICENSE file in the project root for full license information.
|
// Licensed under the MIT license. See LICENSE file in the project root for full license information.
|
||||||
//
|
//
|
||||||
|
|
||||||
using System.ComponentModel;
|
|
||||||
using System.Text;
|
|
||||||
using Microsoft.SqlServer.Management.Smo;
|
|
||||||
using Microsoft.SqlServer.Management.Sdk.Sfc;
|
|
||||||
using Microsoft.SqlServer.Management.Diagnostics;
|
|
||||||
using System.Globalization;
|
|
||||||
using System.Data.SqlClient;
|
|
||||||
using AzureEdition = Microsoft.SqlTools.ServiceLayer.Admin.AzureSqlDbHelper.AzureEdition;
|
|
||||||
using Microsoft.SqlServer.Management.Common;
|
|
||||||
using System;
|
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
|
using System.ComponentModel;
|
||||||
|
using System.Data.SqlClient;
|
||||||
|
using System.Globalization;
|
||||||
using System.Linq;
|
using System.Linq;
|
||||||
|
using Microsoft.SqlServer.Management.Common;
|
||||||
|
using Microsoft.SqlServer.Management.Sdk.Sfc;
|
||||||
|
using Microsoft.SqlServer.Management.Smo;
|
||||||
|
using AzureEdition = Microsoft.SqlTools.ServiceLayer.Admin.AzureSqlDbHelper.AzureEdition;
|
||||||
|
|
||||||
namespace Microsoft.SqlTools.ServiceLayer.Admin
|
namespace Microsoft.SqlTools.ServiceLayer.Admin
|
||||||
{
|
{
|
||||||
@@ -102,10 +99,12 @@ namespace Microsoft.SqlTools.ServiceLayer.Admin
|
|||||||
{
|
{
|
||||||
get
|
get
|
||||||
{
|
{
|
||||||
return AzureSqlDbHelper.GetAzureEditionDisplayName(this.currentState.azureEdition);
|
return this.currentState.azureEditionDisplayValue;
|
||||||
}
|
}
|
||||||
set
|
set
|
||||||
{
|
{
|
||||||
|
// TODO set from here should probably allow for the fact that System is a valid edition for
|
||||||
|
// actual system DBs. Not handling for now
|
||||||
AzureEdition edition;
|
AzureEdition edition;
|
||||||
if (AzureSqlDbHelper.TryGetAzureEditionFromDisplayName(value, out edition))
|
if (AzureSqlDbHelper.TryGetAzureEditionFromDisplayName(value, out edition))
|
||||||
{
|
{
|
||||||
@@ -115,6 +114,7 @@ namespace Microsoft.SqlTools.ServiceLayer.Admin
|
|||||||
}
|
}
|
||||||
|
|
||||||
this.currentState.azureEdition = edition;
|
this.currentState.azureEdition = edition;
|
||||||
|
this.currentState.azureEditionDisplayValue = value;
|
||||||
this.CurrentServiceLevelObjective = AzureSqlDbHelper.GetDefaultServiceObjective(edition);
|
this.CurrentServiceLevelObjective = AzureSqlDbHelper.GetDefaultServiceObjective(edition);
|
||||||
this.MaxSize = AzureSqlDbHelper.GetDatabaseDefaultSize(edition).ToString();
|
this.MaxSize = AzureSqlDbHelper.GetDatabaseDefaultSize(edition).ToString();
|
||||||
this.NotifyObservers();
|
this.NotifyObservers();
|
||||||
|
|||||||
@@ -150,9 +150,20 @@ namespace Microsoft.SqlTools.ServiceLayer.Admin
|
|||||||
databaseInfo.Options.Add(itemPrefix + AdminServicesProviderOptionsHelper.IsPrimaryFile, file.IsPrimaryFile);
|
databaseInfo.Options.Add(itemPrefix + AdminServicesProviderOptionsHelper.IsPrimaryFile, file.IsPrimaryFile);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
AddAzureProperties(databaseInfo, prototype as DatabasePrototypeAzure);
|
||||||
|
|
||||||
return databaseInfo;
|
return databaseInfo;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private static void AddAzureProperties(DatabaseInfo databaseInfo, DatabasePrototypeAzure prototype)
|
||||||
|
{
|
||||||
|
if (prototype == null) { return; }
|
||||||
|
|
||||||
|
databaseInfo.Options.Add(AdminServicesProviderOptionsHelper.AzureEdition, prototype.AzureEditionDisplay);
|
||||||
|
databaseInfo.Options.Add(AdminServicesProviderOptionsHelper.ServiceLevelObjective, prototype.CurrentServiceLevelObjective);
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
private static string GetBackupDate(DateTime backupDate)
|
private static string GetBackupDate(DateTime backupDate)
|
||||||
{
|
{
|
||||||
if (backupDate == null
|
if (backupDate == null
|
||||||
|
|||||||
@@ -63,9 +63,14 @@ namespace Microsoft.SqlTools.ServiceLayer.Connection
|
|||||||
public InteractionMetrics<double> IntellisenseMetrics { get; private set; }
|
public InteractionMetrics<double> IntellisenseMetrics { get; private set; }
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Returns true is the db connection is to a SQL db
|
/// Returns true if the db connection is to any cloud instance
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public bool IsAzure { get; set; }
|
public bool IsCloud { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Returns true if the db connection is to a SQL db instance
|
||||||
|
/// </summary>
|
||||||
|
public bool IsSqlDb { get; set; }
|
||||||
|
|
||||||
/// Returns true if the sql connection is to a DW instance
|
/// Returns true if the sql connection is to a DW instance
|
||||||
/// </summary>
|
/// </summary>
|
||||||
|
|||||||
@@ -463,8 +463,9 @@ namespace Microsoft.SqlTools.ServiceLayer.Connection
|
|||||||
OsVersion = serverInfo.OsVersion,
|
OsVersion = serverInfo.OsVersion,
|
||||||
MachineName = serverInfo.MachineName
|
MachineName = serverInfo.MachineName
|
||||||
};
|
};
|
||||||
connectionInfo.IsAzure = serverInfo.IsCloud;
|
connectionInfo.IsCloud = serverInfo.IsCloud;
|
||||||
connectionInfo.MajorVersion = serverInfo.ServerMajorVersion;
|
connectionInfo.MajorVersion = serverInfo.ServerMajorVersion;
|
||||||
|
connectionInfo.IsSqlDb = serverInfo.EngineEditionId == (int)DatabaseEngineEdition.SqlDatabase;
|
||||||
connectionInfo.IsSqlDW = (serverInfo.EngineEditionId == (int)DatabaseEngineEdition.SqlDataWarehouse);
|
connectionInfo.IsSqlDW = (serverInfo.EngineEditionId == (int)DatabaseEngineEdition.SqlDataWarehouse);
|
||||||
}
|
}
|
||||||
catch (Exception ex)
|
catch (Exception ex)
|
||||||
@@ -1293,7 +1294,7 @@ namespace Microsoft.SqlTools.ServiceLayer.Connection
|
|||||||
{
|
{
|
||||||
Properties = new Dictionary<string, string>
|
Properties = new Dictionary<string, string>
|
||||||
{
|
{
|
||||||
{ TelemetryPropertyNames.IsAzure, connectionInfo.IsAzure.ToOneOrZeroString() }
|
{ TelemetryPropertyNames.IsAzure, connectionInfo.IsCloud.ToOneOrZeroString() }
|
||||||
},
|
},
|
||||||
EventName = TelemetryEventNames.IntellisenseQuantile,
|
EventName = TelemetryEventNames.IntellisenseQuantile,
|
||||||
Measures = connectionInfo.IntellisenseMetrics.Quantile
|
Measures = connectionInfo.IntellisenseMetrics.Quantile
|
||||||
|
|||||||
@@ -37,7 +37,8 @@ namespace Microsoft.SqlTools.ServiceLayer.Connection.ReliableConnection
|
|||||||
|
|
||||||
public enum CacheVariable {
|
public enum CacheVariable {
|
||||||
IsSqlDw,
|
IsSqlDw,
|
||||||
IsAzure
|
IsAzure,
|
||||||
|
IsCloud
|
||||||
}
|
}
|
||||||
|
|
||||||
#region CacheKey implementation
|
#region CacheKey implementation
|
||||||
@@ -151,6 +152,11 @@ namespace Microsoft.SqlTools.ServiceLayer.Connection.ReliableConnection
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public void AddOrUpdateIsCloud(IDbConnection connection, bool isCloud)
|
||||||
|
{
|
||||||
|
AddOrUpdateCache(connection, isCloud, CacheVariable.IsCloud);
|
||||||
|
}
|
||||||
|
|
||||||
public void AddOrUpdateIsAzure(IDbConnection connection, bool isAzure)
|
public void AddOrUpdateIsAzure(IDbConnection connection, bool isAzure)
|
||||||
{
|
{
|
||||||
AddOrUpdateCache(connection, isAzure, CacheVariable.IsAzure);
|
AddOrUpdateCache(connection, isAzure, CacheVariable.IsAzure);
|
||||||
|
|||||||
@@ -34,6 +34,14 @@ namespace Microsoft.SqlTools.ServiceLayer.Connection.ReliableConnection
|
|||||||
// http://msdn.microsoft.com/en-us/library/ee336261.aspx
|
// http://msdn.microsoft.com/en-us/library/ee336261.aspx
|
||||||
private const int SqlAzureEngineEditionId = 5;
|
private const int SqlAzureEngineEditionId = 5;
|
||||||
|
|
||||||
|
private static Lazy<HashSet<int>> cloudEditions = new Lazy<HashSet<int>>(() => new HashSet<int>()
|
||||||
|
{
|
||||||
|
(int)DatabaseEngineEdition.SqlDatabase,
|
||||||
|
(int)DatabaseEngineEdition.SqlDataWarehouse,
|
||||||
|
(int)DatabaseEngineEdition.SqlStretchDatabase,
|
||||||
|
// Note: for now, ignoring managed instance as it should be treated just like on prem.
|
||||||
|
});
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Opens the connection and sets the lock/command timeout and pooling=false.
|
/// Opens the connection and sets the lock/command timeout and pooling=false.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
@@ -457,7 +465,7 @@ namespace Microsoft.SqlTools.ServiceLayer.Connection.ReliableConnection
|
|||||||
|
|
||||||
private static bool IsCloudEngineId(int engineEditionId)
|
private static bool IsCloudEngineId(int engineEditionId)
|
||||||
{
|
{
|
||||||
return engineEditionId == SqlAzureEngineEditionId;
|
return cloudEditions.Value.Contains(engineEditionId);
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
@@ -685,14 +693,6 @@ namespace Microsoft.SqlTools.ServiceLayer.Connection.ReliableConnection
|
|||||||
// of this, we must detect the presence of the column to determine if we can query for Selective Xml Indexes
|
// of this, we must detect the presence of the column to determine if we can query for Selective Xml Indexes
|
||||||
public bool IsSelectiveXmlIndexMetadataPresent;
|
public bool IsSelectiveXmlIndexMetadataPresent;
|
||||||
|
|
||||||
public bool IsAzureV1
|
|
||||||
{
|
|
||||||
get
|
|
||||||
{
|
|
||||||
return IsCloud && AzureVersion == 1;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
public string OsVersion;
|
public string OsVersion;
|
||||||
|
|
||||||
public string MachineName;
|
public string MachineName;
|
||||||
@@ -782,7 +782,7 @@ namespace Microsoft.SqlTools.ServiceLayer.Connection.ReliableConnection
|
|||||||
|
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
CachedServerInfo.Instance.AddOrUpdateIsAzure(connection, serverInfo.IsCloud);
|
CachedServerInfo.Instance.AddOrUpdateIsCloud(connection, serverInfo.IsCloud);
|
||||||
}
|
}
|
||||||
catch (Exception ex)
|
catch (Exception ex)
|
||||||
{
|
{
|
||||||
@@ -949,8 +949,6 @@ namespace Microsoft.SqlTools.ServiceLayer.Connection.ReliableConnection
|
|||||||
}
|
}
|
||||||
|
|
||||||
// SQL Azure does not support custom DBCompat values.
|
// SQL Azure does not support custom DBCompat values.
|
||||||
if (!serverInfo.IsAzureV1)
|
|
||||||
{
|
|
||||||
SqlParameter databaseNameParameter = new SqlParameter(
|
SqlParameter databaseNameParameter = new SqlParameter(
|
||||||
"@dbname",
|
"@dbname",
|
||||||
SqlDbType.NChar,
|
SqlDbType.NChar,
|
||||||
@@ -988,11 +986,6 @@ namespace Microsoft.SqlTools.ServiceLayer.Connection.ReliableConnection
|
|||||||
conString, dbName);
|
conString, dbName);
|
||||||
Tracer.TraceEvent(TraceEventType.Error, TraceId.CoreServices, message);
|
Tracer.TraceEvent(TraceEventType.Error, TraceId.CoreServices, message);
|
||||||
}
|
}
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
foundVersion = true;
|
|
||||||
}
|
|
||||||
},
|
},
|
||||||
catchException: null, // Always throw
|
catchException: null, // Always throw
|
||||||
useRetry: true);
|
useRetry: true);
|
||||||
|
|||||||
@@ -146,7 +146,7 @@ namespace Microsoft.SqlTools.ServiceLayer.DisasterRecovery
|
|||||||
{
|
{
|
||||||
using (SqlConnection sqlConn = ConnectionService.OpenSqlConnection(connInfo, "Backup"))
|
using (SqlConnection sqlConn = ConnectionService.OpenSqlConnection(connInfo, "Backup"))
|
||||||
{
|
{
|
||||||
if (sqlConn != null && !connInfo.IsSqlDW && !connInfo.IsAzure)
|
if (sqlConn != null && !connInfo.IsCloud)
|
||||||
{
|
{
|
||||||
BackupConfigInfo backupConfigInfo = this.GetBackupConfigInfo(helper.DataContainer, sqlConn, sqlConn.Database);
|
BackupConfigInfo backupConfigInfo = this.GetBackupConfigInfo(helper.DataContainer, sqlConn, sqlConn.Database);
|
||||||
backupConfigInfo.DatabaseInfo = AdminService.GetDatabaseInfo(connInfo);
|
backupConfigInfo.DatabaseInfo = AdminService.GetDatabaseInfo(connInfo);
|
||||||
@@ -346,7 +346,7 @@ namespace Microsoft.SqlTools.ServiceLayer.DisasterRecovery
|
|||||||
{
|
{
|
||||||
using (sqlConn = ConnectionService.OpenSqlConnection(connInfo, "DisasterRecovery"))
|
using (sqlConn = ConnectionService.OpenSqlConnection(connInfo, "DisasterRecovery"))
|
||||||
{
|
{
|
||||||
if (sqlConn != null && !connInfo.IsSqlDW && !connInfo.IsAzure)
|
if (sqlConn != null && !connInfo.IsCloud)
|
||||||
{
|
{
|
||||||
connectionInfo = connInfo;
|
connectionInfo = connInfo;
|
||||||
return true;
|
return true;
|
||||||
|
|||||||
@@ -3309,6 +3309,22 @@ namespace Microsoft.SqlTools.ServiceLayer
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public static string Error_InvalidDirectoryName
|
||||||
|
{
|
||||||
|
get
|
||||||
|
{
|
||||||
|
return Keys.GetString(Keys.Error_InvalidDirectoryName);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public static string Error_ExistingDirectoryName
|
||||||
|
{
|
||||||
|
get
|
||||||
|
{
|
||||||
|
return Keys.GetString(Keys.Error_ExistingDirectoryName);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
public static string BackupTaskName
|
public static string BackupTaskName
|
||||||
{
|
{
|
||||||
get
|
get
|
||||||
@@ -4915,6 +4931,12 @@ namespace Microsoft.SqlTools.ServiceLayer
|
|||||||
public const string NeverBackedUp = "NeverBackedUp";
|
public const string NeverBackedUp = "NeverBackedUp";
|
||||||
|
|
||||||
|
|
||||||
|
public const string Error_InvalidDirectoryName = "Error_InvalidDirectoryName";
|
||||||
|
|
||||||
|
|
||||||
|
public const string Error_ExistingDirectoryName = "Error_ExistingDirectoryName";
|
||||||
|
|
||||||
|
|
||||||
public const string BackupTaskName = "BackupTaskName";
|
public const string BackupTaskName = "BackupTaskName";
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -1827,6 +1827,14 @@
|
|||||||
<value>Never</value>
|
<value>Never</value>
|
||||||
<comment></comment>
|
<comment></comment>
|
||||||
</data>
|
</data>
|
||||||
|
<data name="Error_InvalidDirectoryName" xml:space="preserve">
|
||||||
|
<value>Path {0} is not a valid directory </value>
|
||||||
|
<comment></comment>
|
||||||
|
</data>
|
||||||
|
<data name="Error_ExistingDirectoryName" xml:space="preserve">
|
||||||
|
<value>For directory {0} a file with name {1} already exists</value>
|
||||||
|
<comment></comment>
|
||||||
|
</data>
|
||||||
<data name="BackupTaskName" xml:space="preserve">
|
<data name="BackupTaskName" xml:space="preserve">
|
||||||
<value>Backup Database</value>
|
<value>Backup Database</value>
|
||||||
<comment></comment>
|
<comment></comment>
|
||||||
|
|||||||
@@ -808,6 +808,8 @@ general_containmentType_Partial = Partial
|
|||||||
filegroups_filestreamFiles = FILESTREAM Files
|
filegroups_filestreamFiles = FILESTREAM Files
|
||||||
prototype_file_noApplicableFileGroup = No Applicable Filegroup
|
prototype_file_noApplicableFileGroup = No Applicable Filegroup
|
||||||
NeverBackedUp = Never
|
NeverBackedUp = Never
|
||||||
|
Error_InvalidDirectoryName = Path {0} is not a valid directory
|
||||||
|
Error_ExistingDirectoryName = For directory {0} a file with name {1} already exists
|
||||||
|
|
||||||
############################################################################
|
############################################################################
|
||||||
# Backup Service
|
# Backup Service
|
||||||
|
|||||||
@@ -2295,6 +2295,16 @@
|
|||||||
<target state="new">Azure SQL Stretch Database</target>
|
<target state="new">Azure SQL Stretch Database</target>
|
||||||
<note></note>
|
<note></note>
|
||||||
</trans-unit>
|
</trans-unit>
|
||||||
|
<trans-unit id="Error_InvalidDirectoryName">
|
||||||
|
<source>Path {0} is not a valid directory </source>
|
||||||
|
<target state="new">Path {0} is not a valid directory </target>
|
||||||
|
<note></note>
|
||||||
|
</trans-unit>
|
||||||
|
<trans-unit id="Error_ExistingDirectoryName">
|
||||||
|
<source>For directory {0} a file with name {1} already exists</source>
|
||||||
|
<target state="new">For directory {0} a file with name {1} already exists</target>
|
||||||
|
<note></note>
|
||||||
|
</trans-unit>
|
||||||
</body>
|
</body>
|
||||||
</file>
|
</file>
|
||||||
</xliff>
|
</xliff>
|
||||||
@@ -40,6 +40,7 @@ namespace Microsoft.SqlTools.ServiceLayer.Scripting
|
|||||||
targetDatabaseEngineEditionMap.Add(DatabaseEngineEdition.SqlDatabase, "SqlAzureDatabaseEdition");
|
targetDatabaseEngineEditionMap.Add(DatabaseEngineEdition.SqlDatabase, "SqlAzureDatabaseEdition");
|
||||||
targetDatabaseEngineEditionMap.Add(DatabaseEngineEdition.SqlDataWarehouse, "SqlDatawarehouseEdition");
|
targetDatabaseEngineEditionMap.Add(DatabaseEngineEdition.SqlDataWarehouse, "SqlDatawarehouseEdition");
|
||||||
targetDatabaseEngineEditionMap.Add(DatabaseEngineEdition.SqlStretchDatabase, "SqlServerStretchEdition");
|
targetDatabaseEngineEditionMap.Add(DatabaseEngineEdition.SqlStretchDatabase, "SqlServerStretchEdition");
|
||||||
|
targetDatabaseEngineEditionMap.Add(DatabaseEngineEdition.SqlManagedInstance, "SqlServerManagedInstance");
|
||||||
|
|
||||||
// Mapping for database engine type
|
// Mapping for database engine type
|
||||||
serverVersionMap.Add(9, "Script90Compat");
|
serverVersionMap.Add(9, "Script90Compat");
|
||||||
|
|||||||
@@ -96,7 +96,7 @@ namespace Microsoft.SqlTools.ServiceLayer.Scripting
|
|||||||
{
|
{
|
||||||
Logger.Write(LogLevel.Error, "Exception at PeekDefinition Database.get() : " + cfe.Message);
|
Logger.Write(LogLevel.Error, "Exception at PeekDefinition Database.get() : " + cfe.Message);
|
||||||
this.error = true;
|
this.error = true;
|
||||||
this.errorMessage = (connectionInfo != null && connectionInfo.IsAzure) ? SR.PeekDefinitionAzureError(cfe.Message) : SR.PeekDefinitionError(cfe.Message);
|
this.errorMessage = (connectionInfo != null && connectionInfo.IsCloud) ? SR.PeekDefinitionAzureError(cfe.Message) : SR.PeekDefinitionError(cfe.Message);
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
catch (Exception ex)
|
catch (Exception ex)
|
||||||
@@ -513,7 +513,8 @@ namespace Microsoft.SqlTools.ServiceLayer.Scripting
|
|||||||
internal string GetTargetDatabaseEngineEdition()
|
internal string GetTargetDatabaseEngineEdition()
|
||||||
{
|
{
|
||||||
DatabaseEngineEdition dbEngineEdition = this.serverConnection.DatabaseEngineEdition;
|
DatabaseEngineEdition dbEngineEdition = this.serverConnection.DatabaseEngineEdition;
|
||||||
string dbEngineEditionString = targetDatabaseEngineEditionMap[dbEngineEdition];
|
string dbEngineEditionString;
|
||||||
|
targetDatabaseEngineEditionMap.TryGetValue(dbEngineEdition, out dbEngineEditionString);
|
||||||
return (dbEngineEditionString != null) ? dbEngineEditionString : "SqlServerEnterpriseEdition";
|
return (dbEngineEditionString != null) ? dbEngineEditionString : "SqlServerEnterpriseEdition";
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -526,7 +527,7 @@ namespace Microsoft.SqlTools.ServiceLayer.Scripting
|
|||||||
|
|
||||||
internal string GetTargetDatabaseEngineType()
|
internal string GetTargetDatabaseEngineType()
|
||||||
{
|
{
|
||||||
return connectionInfo.IsAzure ? "SqlAzure" : "SingleInstance";
|
return connectionInfo.IsCloud ? "SqlAzure" : "SingleInstance";
|
||||||
}
|
}
|
||||||
|
|
||||||
internal bool LineContainsObject(string line, string objectName, string createSyntax)
|
internal bool LineContainsObject(string line, string objectName, string createSyntax)
|
||||||
|
|||||||
@@ -317,7 +317,6 @@ namespace Microsoft.SqlTools.ServiceLayer.IntegrationTests.Connection
|
|||||||
Assert.True(serverInfo.ServerEdition == serverInfo2.ServerEdition);
|
Assert.True(serverInfo.ServerEdition == serverInfo2.ServerEdition);
|
||||||
Assert.True(serverInfo.IsCloud == serverInfo2.IsCloud);
|
Assert.True(serverInfo.IsCloud == serverInfo2.IsCloud);
|
||||||
Assert.True(serverInfo.AzureVersion == serverInfo2.AzureVersion);
|
Assert.True(serverInfo.AzureVersion == serverInfo2.AzureVersion);
|
||||||
Assert.True(serverInfo.IsAzureV1 == serverInfo2.IsAzureV1);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user