Ledger Objects Representation in Object Explorer (#1615)

* support for ledger objects in OE

* generated sr files

* update versionKey to sql 2022 in test env config

* more 2019 to 2022 updates

* add sql2022 instead of replacing

* missed filter on table

* add logging

* more logging

* adding Script160Compat options for sql2022

Co-authored-by: Alan Ren <alanren@microsoft.com>
This commit is contained in:
Jordan Hays
2022-08-05 13:53:17 -04:00
committed by GitHub
parent 1789fd1233
commit d78ff94b31
25 changed files with 442 additions and 53 deletions

View File

@@ -785,6 +785,18 @@ namespace Microsoft.SqlTools.ServiceLayer.ObjectExplorer.SmoModel
{ TableTemporalType.SystemVersioned }
}
});
filters.Add(new NodePropertyFilter
{
Property = "LedgerType",
Type = typeof(Enum),
ValidFor = ValidForFlag.Sql2022|ValidForFlag.AzureV12,
Values = new List<object>
{
{ LedgerTableType.None },
{ LedgerTableType.AppendOnlyLedgerTable },
{ LedgerTableType.UpdatableLedgerTable }
}
});
return filters;
}
}
@@ -810,6 +822,11 @@ namespace Microsoft.SqlTools.ServiceLayer.ObjectExplorer.SmoModel
ValidFor = ValidForFlag.Sql2016|ValidForFlag.Sql2017|ValidForFlag.Sql2019|ValidForFlag.Sql2022|ValidForFlag.AzureV12
});
properties.Add(new NodeSmoProperty
{
Name = "LedgerType",
ValidFor = ValidForFlag.Sql2022|ValidForFlag.AzureV12
});
properties.Add(new NodeSmoProperty
{
Name = "IsExternal",
ValidFor = ValidForFlag.Sql2016|ValidForFlag.Sql2017|ValidForFlag.Sql2019|ValidForFlag.Sql2022|ValidForFlag.AzureV12|ValidForFlag.SqlOnDemand
@@ -1312,21 +1329,56 @@ namespace Microsoft.SqlTools.ServiceLayer.ObjectExplorer.SmoModel
get
{
var filters = new List<INodeFilter>();
filters.Add(new NodePropertyFilter
filters.Add(new NodeOrFilter
{
Property = "TemporalType",
Type = typeof(Enum),
TypeToReverse = typeof(SqlHistoryTableQuerier),
ValidFor = ValidForFlag.Sql2016|ValidForFlag.Sql2017|ValidForFlag.Sql2019|ValidForFlag.Sql2022|ValidForFlag.AzureV12,
Values = new List<object>
{
{ TableTemporalType.HistoryTable }
FilterList = new List<NodePropertyFilter> {
new NodePropertyFilter
{
Property = "TemporalType",
Type = typeof(Enum),
TypeToReverse = typeof(SqlHistoryTableQuerier),
ValidFor = ValidForFlag.Sql2016|ValidForFlag.Sql2017|ValidForFlag.Sql2019|ValidForFlag.Sql2022|ValidForFlag.AzureV12,
Values = new List<object>
{
{ TableTemporalType.HistoryTable }
}
},
new NodePropertyFilter
{
Property = "LedgerType",
Type = typeof(Enum),
TypeToReverse = typeof(SqlHistoryTableQuerier),
ValidFor = ValidForFlag.Sql2022|ValidForFlag.AzureV12,
Values = new List<object>
{
{ LedgerTableType.HistoryTable }
}
},
}
});
return filters;
}
}
public override IEnumerable<NodeSmoProperty> SmoProperties
{
get
{
var properties = new List<NodeSmoProperty>();
properties.Add(new NodeSmoProperty
{
Name = "LedgerType",
ValidFor = ValidForFlag.Sql2022|ValidForFlag.AzureV12
});
properties.Add(new NodeSmoProperty
{
Name = "TemporalType",
ValidFor = ValidForFlag.Sql2016|ValidForFlag.Sql2017|ValidForFlag.Sql2019|ValidForFlag.Sql2022|ValidForFlag.AzureV12
});
return properties;
}
}
protected override void OnExpandPopulateFolders(IList<TreeNode> currentChildren, TreeNode parent)
{
currentChildren.Add(new FolderNode {