mirror of
https://github.com/ckaczor/sqltoolsservice.git
synced 2026-02-16 10:58:30 -05:00
Dropped Ledger Tables Folder (#1625)
* support and testing for Dropped Ledger Table folder * appending DroppedLedgerTables nodetype * fixing unit tests * undoing string.Empty
This commit is contained in:
@@ -1,5 +1,5 @@
|
|||||||
// WARNING:
|
// WARNING:
|
||||||
// This file was generated by the Microsoft DataWarehouse String Resource Tool 5.0.0.0
|
// This file was generated by the Microsoft DataWarehouse String Resource Tool 4.0.0.0
|
||||||
// from information in sr.strings
|
// from information in sr.strings
|
||||||
// DO NOT MODIFY THIS FILE'S CONTENTS, THEY WILL BE OVERWRITTEN
|
// DO NOT MODIFY THIS FILE'S CONTENTS, THEY WILL BE OVERWRITTEN
|
||||||
//
|
//
|
||||||
@@ -2045,6 +2045,14 @@ namespace Microsoft.SqlTools.ServiceLayer
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public static string SchemaHierarchy_DroppedLedgerTables
|
||||||
|
{
|
||||||
|
get
|
||||||
|
{
|
||||||
|
return Keys.GetString(Keys.SchemaHierarchy_DroppedLedgerTables);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
public static string SchemaHierarchy_AlwaysEncryptedKeys
|
public static string SchemaHierarchy_AlwaysEncryptedKeys
|
||||||
{
|
{
|
||||||
get
|
get
|
||||||
@@ -10645,6 +10653,9 @@ namespace Microsoft.SqlTools.ServiceLayer
|
|||||||
public const string SchemaHierarchy_ExternalTables = "SchemaHierarchy_ExternalTables";
|
public const string SchemaHierarchy_ExternalTables = "SchemaHierarchy_ExternalTables";
|
||||||
|
|
||||||
|
|
||||||
|
public const string SchemaHierarchy_DroppedLedgerTables = "SchemaHierarchy_DroppedLedgerTables";
|
||||||
|
|
||||||
|
|
||||||
public const string SchemaHierarchy_AlwaysEncryptedKeys = "SchemaHierarchy_AlwaysEncryptedKeys";
|
public const string SchemaHierarchy_AlwaysEncryptedKeys = "SchemaHierarchy_AlwaysEncryptedKeys";
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -1280,6 +1280,10 @@
|
|||||||
<value>External Tables</value>
|
<value>External Tables</value>
|
||||||
<comment></comment>
|
<comment></comment>
|
||||||
</data>
|
</data>
|
||||||
|
<data name="SchemaHierarchy_DroppedLedgerTables" xml:space="preserve">
|
||||||
|
<value>Dropped Ledger Tables</value>
|
||||||
|
<comment></comment>
|
||||||
|
</data>
|
||||||
<data name="SchemaHierarchy_AlwaysEncryptedKeys" xml:space="preserve">
|
<data name="SchemaHierarchy_AlwaysEncryptedKeys" xml:space="preserve">
|
||||||
<value>Always Encrypted Keys</value>
|
<value>Always Encrypted Keys</value>
|
||||||
<comment></comment>
|
<comment></comment>
|
||||||
|
|||||||
@@ -630,6 +630,8 @@ SchemaHierarchy_ExternalResources = External Resources
|
|||||||
|
|
||||||
SchemaHierarchy_ExternalTables = External Tables
|
SchemaHierarchy_ExternalTables = External Tables
|
||||||
|
|
||||||
|
SchemaHierarchy_DroppedLedgerTables = Dropped Ledger Tables
|
||||||
|
|
||||||
SchemaHierarchy_AlwaysEncryptedKeys = Always Encrypted Keys
|
SchemaHierarchy_AlwaysEncryptedKeys = Always Encrypted Keys
|
||||||
|
|
||||||
SchemaHierarchy_ColumnMasterKeys = Column Master Keys
|
SchemaHierarchy_ColumnMasterKeys = Column Master Keys
|
||||||
|
|||||||
@@ -6321,6 +6321,11 @@ The Query Processor estimates that implementing the following index could improv
|
|||||||
<target state="new">Ledger</target>
|
<target state="new">Ledger</target>
|
||||||
<note></note>
|
<note></note>
|
||||||
</trans-unit>
|
</trans-unit>
|
||||||
|
<trans-unit id="SchemaHierarchy_DroppedLedgerTables">
|
||||||
|
<source>Dropped Ledger Tables</source>
|
||||||
|
<target state="new">Dropped Ledger Tables</target>
|
||||||
|
<note></note>
|
||||||
|
</trans-unit>
|
||||||
</body>
|
</body>
|
||||||
</file>
|
</file>
|
||||||
</xliff>
|
</xliff>
|
||||||
@@ -139,6 +139,7 @@ namespace Microsoft.SqlTools.ServiceLayer.ObjectExplorer.Nodes
|
|||||||
ExternalTable,
|
ExternalTable,
|
||||||
AlwaysEncryptedKeys,
|
AlwaysEncryptedKeys,
|
||||||
ColumnMasterKeys,
|
ColumnMasterKeys,
|
||||||
ColumnEncryptionKeys
|
ColumnEncryptionKeys,
|
||||||
|
DroppedLedgerTables,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -797,6 +797,13 @@ namespace Microsoft.SqlTools.ServiceLayer.ObjectExplorer.SmoModel
|
|||||||
{ LedgerTableType.UpdatableLedgerTable }
|
{ LedgerTableType.UpdatableLedgerTable }
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
filters.Add(new NodePropertyFilter
|
||||||
|
{
|
||||||
|
Property = "IsDroppedLedgerTable",
|
||||||
|
Type = typeof(bool),
|
||||||
|
ValidFor = ValidForFlag.Sql2022|ValidForFlag.AzureV12,
|
||||||
|
Values = new List<object> { 0 },
|
||||||
|
});
|
||||||
return filters;
|
return filters;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -845,6 +852,14 @@ namespace Microsoft.SqlTools.ServiceLayer.ObjectExplorer.SmoModel
|
|||||||
IsMsShippedOwned = true,
|
IsMsShippedOwned = true,
|
||||||
SortPriority = SmoTreeNode.NextSortPriority,
|
SortPriority = SmoTreeNode.NextSortPriority,
|
||||||
});
|
});
|
||||||
|
currentChildren.Add(new FolderNode {
|
||||||
|
NodeValue = SR.SchemaHierarchy_DroppedLedgerTables,
|
||||||
|
NodeType = "Folder",
|
||||||
|
NodeTypeId = NodeTypes.DroppedLedgerTables,
|
||||||
|
IsSystemObject = false,
|
||||||
|
ValidFor = ValidForFlag.Sql2022|ValidForFlag.AzureV12,
|
||||||
|
SortPriority = SmoTreeNode.NextSortPriority,
|
||||||
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
internal override Type[] ChildQuerierTypes
|
internal override Type[] ChildQuerierTypes
|
||||||
@@ -1318,6 +1333,57 @@ namespace Microsoft.SqlTools.ServiceLayer.ObjectExplorer.SmoModel
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
[Export(typeof(ChildFactory))]
|
||||||
|
[Shared]
|
||||||
|
internal partial class DroppedLedgerTablesChildFactory : SmoChildFactoryBase
|
||||||
|
{
|
||||||
|
public override IEnumerable<string> ApplicableParents() { return new[] { "DroppedLedgerTables" }; }
|
||||||
|
|
||||||
|
public override IEnumerable<INodeFilter> Filters
|
||||||
|
{
|
||||||
|
get
|
||||||
|
{
|
||||||
|
var filters = new List<INodeFilter>();
|
||||||
|
filters.Add(new NodePropertyFilter
|
||||||
|
{
|
||||||
|
Property = "IsDroppedLedgerTable",
|
||||||
|
Type = typeof(bool),
|
||||||
|
Values = new List<object> { 1 },
|
||||||
|
});
|
||||||
|
return filters;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public override IEnumerable<NodeSmoProperty> SmoProperties
|
||||||
|
{
|
||||||
|
get
|
||||||
|
{
|
||||||
|
var properties = new List<NodeSmoProperty>();
|
||||||
|
properties.Add(new NodeSmoProperty
|
||||||
|
{
|
||||||
|
Name = "IsDroppedLedgerTable",
|
||||||
|
ValidFor = ValidForFlag.Sql2022|ValidForFlag.AzureV12
|
||||||
|
});
|
||||||
|
return properties;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
internal override Type[] ChildQuerierTypes
|
||||||
|
{
|
||||||
|
get
|
||||||
|
{
|
||||||
|
return new [] { typeof(SqlTableQuerier), };
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public override TreeNode CreateChild(TreeNode parent, object context)
|
||||||
|
{
|
||||||
|
var child = new TableTreeNode();
|
||||||
|
InitializeChild(parent, child, context);
|
||||||
|
return child;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
[Export(typeof(ChildFactory))]
|
[Export(typeof(ChildFactory))]
|
||||||
[Shared]
|
[Shared]
|
||||||
internal partial class TableChildFactory : SmoChildFactoryBase
|
internal partial class TableChildFactory : SmoChildFactoryBase
|
||||||
|
|||||||
@@ -82,6 +82,7 @@
|
|||||||
<Value>LedgerTableType.AppendOnlyLedgerTable</Value>
|
<Value>LedgerTableType.AppendOnlyLedgerTable</Value>
|
||||||
<Value>LedgerTableType.UpdatableLedgerTable</Value>
|
<Value>LedgerTableType.UpdatableLedgerTable</Value>
|
||||||
</Filter>
|
</Filter>
|
||||||
|
<Filter Property="IsDroppedLedgerTable" Value="0" Type="bool" ValidFor="Sql2022|AzureV12" />
|
||||||
</Filters>
|
</Filters>
|
||||||
<Properties>
|
<Properties>
|
||||||
<Property Name="IsFileTable" ValidFor="Sql2012|Sql2014|Sql2016|Sql2017|Sql2019|Sql2022"/>
|
<Property Name="IsFileTable" ValidFor="Sql2012|Sql2014|Sql2016|Sql2017|Sql2019|Sql2022"/>
|
||||||
@@ -92,6 +93,7 @@
|
|||||||
</Properties>
|
</Properties>
|
||||||
<Child Name="SystemTables" IsSystemObject="1"/>
|
<Child Name="SystemTables" IsSystemObject="1"/>
|
||||||
<Child Name="ExternalTables"/>
|
<Child Name="ExternalTables"/>
|
||||||
|
<Child Name="DroppedLedgerTables" IsDroppedLedgerTable="1"/>
|
||||||
</Node>
|
</Node>
|
||||||
|
|
||||||
<Node Name="Views" LocLabel="SR.SchemaHierarchy_Views" BaseClass="ModelBased" Strategy="MultipleElementsOfType" ChildQuerierTypes="SqlView" TreeNode="ViewTreeNode">
|
<Node Name="Views" LocLabel="SR.SchemaHierarchy_Views" BaseClass="ModelBased" Strategy="MultipleElementsOfType" ChildQuerierTypes="SqlView" TreeNode="ViewTreeNode">
|
||||||
@@ -161,6 +163,14 @@
|
|||||||
<Filter Property="IsSystemObject" Value="1" Type="bool" />
|
<Filter Property="IsSystemObject" Value="1" Type="bool" />
|
||||||
</Filters>
|
</Filters>
|
||||||
</Node>
|
</Node>
|
||||||
|
<Node Name="DroppedLedgerTables" LocLabel="SR.SchemaHierarchy_DroppedLedgerTables" BaseClass="ModelBased" Strategy="MultipleElementsOfType" ChildQuerierTypes="SqlTable" TreeNode="TableTreeNode" ValidFor="Sql2022|AzureV12">
|
||||||
|
<Filters >
|
||||||
|
<Filter Property="IsDroppedLedgerTable" Value="1" Type="bool" />
|
||||||
|
</Filters>
|
||||||
|
<Properties>
|
||||||
|
<Property Name="IsDroppedLedgerTable" ValidFor="Sql2022|AzureV12"/>
|
||||||
|
</Properties>
|
||||||
|
</Node>
|
||||||
<!--
|
<!--
|
||||||
<Node Name="FileTables" LocLabel="SR.SchemaHierarchy_FileTables" BaseClass="ModelBased" Strategy="MultipleElementsOfType" ChildQuerierTypes="SqlTable" TreeNode="TableTreeNode" ValidFor="Sql2012|Sql2014|Sql2016|Sql2017|Sql2019|Sql2022">
|
<Node Name="FileTables" LocLabel="SR.SchemaHierarchy_FileTables" BaseClass="ModelBased" Strategy="MultipleElementsOfType" ChildQuerierTypes="SqlTable" TreeNode="TableTreeNode" ValidFor="Sql2012|Sql2014|Sql2016|Sql2017|Sql2019|Sql2022">
|
||||||
<Filters >
|
<Filters >
|
||||||
|
|||||||
@@ -10,6 +10,7 @@ using System.IO;
|
|||||||
using System.Linq;
|
using System.Linq;
|
||||||
using System.Reflection;
|
using System.Reflection;
|
||||||
using System.Text;
|
using System.Text;
|
||||||
|
using System.Text.RegularExpressions;
|
||||||
using System.Threading;
|
using System.Threading;
|
||||||
using System.Threading.Tasks;
|
using System.Threading.Tasks;
|
||||||
using Microsoft.SqlTools.ServiceLayer.Connection.Contracts;
|
using Microsoft.SqlTools.ServiceLayer.Connection.Contracts;
|
||||||
@@ -242,8 +243,8 @@ namespace Microsoft.SqlTools.ServiceLayer.IntegrationTests.ObjectExplorer
|
|||||||
//This takes take long to run so not a good test for CI builds
|
//This takes take long to run so not a good test for CI builds
|
||||||
public async Task VerifySystemObjects()
|
public async Task VerifySystemObjects()
|
||||||
{
|
{
|
||||||
string queryFileName = null;
|
string queryFileName = string.Empty;
|
||||||
string baselineFileName = null;
|
string baselineFileName = string.Empty;
|
||||||
string databaseName = "#testDb#";
|
string databaseName = "#testDb#";
|
||||||
await TestServiceProvider.CalculateRunTime(() => VerifyObjectExplorerTest(databaseName, queryFileName, "SystemOBjects", baselineFileName, true), true);
|
await TestServiceProvider.CalculateRunTime(() => VerifyObjectExplorerTest(databaseName, queryFileName, "SystemOBjects", baselineFileName, true), true);
|
||||||
}
|
}
|
||||||
@@ -473,9 +474,13 @@ namespace Microsoft.SqlTools.ServiceLayer.IntegrationTests.ObjectExplorer
|
|||||||
{
|
{
|
||||||
string actual = stringBuilder.ToString();
|
string actual = stringBuilder.ToString();
|
||||||
|
|
||||||
// write output to a bin directory for easier comparison
|
// Dropped ledger objects have a randomly generated GUID appended to their name when they are deleted
|
||||||
string outputRegeneratedFolder = Path.Combine(Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location),
|
// For testing purposes, those guids need to be replaced with a deterministic string
|
||||||
@"ObjectExplorerServiceTests\Baselines\Regenerated");
|
actual = Regex.Replace(actual, "[A-Z0-9]{32}", "<<NonDeterministic>>");
|
||||||
|
|
||||||
|
// Write output to a bin directory for easier comparison
|
||||||
|
string assemblyPath = Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location) ?? string.Empty;
|
||||||
|
string outputRegeneratedFolder = Path.Combine(assemblyPath, @"ObjectExplorerServiceTests\Baselines\Regenerated");
|
||||||
string outputRegeneratedFilePath = Path.Combine(outputRegeneratedFolder, baselineFileName);
|
string outputRegeneratedFilePath = Path.Combine(outputRegeneratedFolder, baselineFileName);
|
||||||
string msg = "";
|
string msg = "";
|
||||||
|
|
||||||
@@ -488,8 +493,8 @@ namespace Microsoft.SqlTools.ServiceLayer.IntegrationTests.ObjectExplorer
|
|||||||
}
|
}
|
||||||
catch (Exception e)
|
catch (Exception e)
|
||||||
{
|
{
|
||||||
//We don't want to fail the test completely if we failed to write the regenerated baseline
|
// We don't want to fail the test completely if we failed to write the regenerated baseline
|
||||||
//(especially if the test passed).
|
// (especially if the test passed).
|
||||||
msg = $"Errors also occurred while attempting to write the new baseline file {outputRegeneratedFilePath} : {e.Message}";
|
msg = $"Errors also occurred while attempting to write the new baseline file {outputRegeneratedFilePath} : {e.Message}";
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -1,3 +1,21 @@
|
|||||||
|
NodeType: Table Label: HumanResources.MSSQL_DroppedLedgerTable_Ledger_For_Drop_<<NonDeterministic>> SubType: Status:
|
||||||
|
NodeType: Column Label: BusinessEntityID (int, not null) SubType: Status:
|
||||||
|
NodeType: Column Label: NationalIDNumber (nvarchar(15), not null) SubType: Status:
|
||||||
|
NodeType: Column Label: LoginID (nvarchar(256), not null) SubType: Status:
|
||||||
|
NodeType: Column Label: OrganizationNode (hierarchyid, null) SubType: Status:
|
||||||
|
NodeType: Column Label: ledger_start_transaction_id (bigint, not null) SubType: Status:
|
||||||
|
NodeType: Column Label: ledger_end_transaction_id (bigint, null) SubType: Status:
|
||||||
|
NodeType: Column Label: ledger_start_sequence_number (bigint, not null) SubType: Status:
|
||||||
|
NodeType: Column Label: ledger_end_sequence_number (bigint, null) SubType: Status:
|
||||||
|
NodeType: HistoryTable Label: HumanResources.MSSQL_DroppedLedgerHistory_Ledger_For_Drop_History_<<NonDeterministic>> (History) SubType:LedgerHistory Status:
|
||||||
|
NodeType: Column Label: BusinessEntityID (int, not null) SubType: Status:
|
||||||
|
NodeType: Column Label: NationalIDNumber (nvarchar(15), not null) SubType: Status:
|
||||||
|
NodeType: Column Label: LoginID (nvarchar(256), not null) SubType: Status:
|
||||||
|
NodeType: Column Label: OrganizationNode (hierarchyid, null) SubType: Status:
|
||||||
|
NodeType: Column Label: ledger_start_transaction_id (bigint, not null) SubType: Status:
|
||||||
|
NodeType: Column Label: ledger_end_transaction_id (bigint, null) SubType: Status:
|
||||||
|
NodeType: Column Label: ledger_start_sequence_number (bigint, not null) SubType: Status:
|
||||||
|
NodeType: Column Label: ledger_end_sequence_number (bigint, null) SubType: Status:
|
||||||
NodeType: Table Label: dbo.tableWithAllDataTypes SubType: Status:
|
NodeType: Table Label: dbo.tableWithAllDataTypes SubType: Status:
|
||||||
NodeType: Column Label: cDecimal (decimal(18,5), null) SubType: Status:
|
NodeType: Column Label: cDecimal (decimal(18,5), null) SubType: Status:
|
||||||
NodeType: Column Label: cNumeric (numeric(18,2), null) SubType: Status:
|
NodeType: Column Label: cNumeric (numeric(18,2), null) SubType: Status:
|
||||||
@@ -198,6 +216,15 @@ NodeType: Column Label: ledger_transaction_id (bigint, null) SubType: Status:
|
|||||||
NodeType: Column Label: ledger_sequence_number (bigint, null) SubType: Status:
|
NodeType: Column Label: ledger_sequence_number (bigint, null) SubType: Status:
|
||||||
NodeType: Column Label: ledger_operation_type (int, not null) SubType: Status:
|
NodeType: Column Label: ledger_operation_type (int, not null) SubType: Status:
|
||||||
NodeType: Column Label: ledger_operation_type_desc (nvarchar(6), not null) SubType: Status:
|
NodeType: Column Label: ledger_operation_type_desc (nvarchar(6), not null) SubType: Status:
|
||||||
|
NodeType: View Label: HumanResources.MSSQL_DroppedLedgerView_Ledger_For_Drop_Ledger_<<NonDeterministic>> (Ledger) SubType:Ledger Status:
|
||||||
|
NodeType: Column Label: BusinessEntityID (int, not null) SubType: Status:
|
||||||
|
NodeType: Column Label: NationalIDNumber (nvarchar(15), not null) SubType: Status:
|
||||||
|
NodeType: Column Label: LoginID (nvarchar(256), not null) SubType: Status:
|
||||||
|
NodeType: Column Label: OrganizationNode (hierarchyid, null) SubType: Status:
|
||||||
|
NodeType: Column Label: ledger_transaction_id (bigint, null) SubType: Status:
|
||||||
|
NodeType: Column Label: ledger_sequence_number (bigint, null) SubType: Status:
|
||||||
|
NodeType: Column Label: ledger_operation_type (int, not null) SubType: Status:
|
||||||
|
NodeType: Column Label: ledger_operation_type_desc (nvarchar(6), not null) SubType: Status:
|
||||||
NodeType: View Label: HumanResources.vEmployee SubType: Status:
|
NodeType: View Label: HumanResources.vEmployee SubType: Status:
|
||||||
NodeType: Column Label: BusinessEntityID (int, not null) SubType: Status:
|
NodeType: Column Label: BusinessEntityID (int, not null) SubType: Status:
|
||||||
NodeType: Column Label: Title (nvarchar(8), null) SubType: Status:
|
NodeType: Column Label: Title (nvarchar(8), null) SubType: Status:
|
||||||
|
|||||||