set graph table types (#1633)

This commit is contained in:
Alan Ren
2022-08-12 15:57:01 -07:00
committed by GitHub
parent 4912f55dec
commit 57b4c25395
3 changed files with 24 additions and 5 deletions

View File

@@ -34,11 +34,11 @@ namespace Microsoft.SqlTools.ServiceLayer.ObjectExplorer.SmoModel
}
else if (table != null && IsPropertySupported("IsExternal", smoContext, table, CachedSmoProperties) && table.IsExternal)
{
return $"{table.Schema}.{table.Name} ({SR.External_LabelPart})";
return $"{table.Schema}.{table.Name} ({SR.External_LabelPart})";
}
else if (table != null && IsPropertySupported("IsFileTable", smoContext, table, CachedSmoProperties) && table.IsFileTable)
{
return $"{table.Schema}.{table.Name} ({SR.FileTable_LabelPart})";
return $"{table.Schema}.{table.Name} ({SR.FileTable_LabelPart})";
}
}
catch
@@ -63,13 +63,20 @@ namespace Microsoft.SqlTools.ServiceLayer.ObjectExplorer.SmoModel
{
return "Temporal";
}
if (table != null && IsPropertySupported("IsEdge", smoContext, table, CachedSmoProperties) && table.IsEdge)
{
return "GraphEdge";
}
if (table != null && IsPropertySupported("IsNode", smoContext, table, CachedSmoProperties) && table.IsNode)
{
return "GraphNode";
}
// TODO carbon issue 3125 enable "External" subtype once icon is ready. Otherwise will get missing icon here.
// else if (table != null && IsPropertySupported("IsExternal", smoContext, table, CachedSmoProperties) && table.IsExternal)
// {
// return "External";
// }
// return string.Empty;
// return string.Empty;
}
catch
{
@@ -112,7 +119,7 @@ namespace Microsoft.SqlTools.ServiceLayer.ObjectExplorer.SmoModel
return "LedgerHistory";
}
}
catch {}
catch { }
return string.Empty;
}

View File

@@ -838,6 +838,16 @@ namespace Microsoft.SqlTools.ServiceLayer.ObjectExplorer.SmoModel
Name = "IsExternal",
ValidFor = ValidForFlag.Sql2016|ValidForFlag.Sql2017|ValidForFlag.Sql2019|ValidForFlag.Sql2022|ValidForFlag.AzureV12|ValidForFlag.SqlOnDemand
});
properties.Add(new NodeSmoProperty
{
Name = "IsEdge",
ValidFor = ValidForFlag.Sql2017|ValidForFlag.Sql2019|ValidForFlag.Sql2022|ValidForFlag.AzureV12
});
properties.Add(new NodeSmoProperty
{
Name = "IsNode",
ValidFor = ValidForFlag.Sql2017|ValidForFlag.Sql2019|ValidForFlag.Sql2022|ValidForFlag.AzureV12
});
return properties;
}
}

View File

@@ -90,6 +90,8 @@
<Property Name="TemporalType" ValidFor="Sql2016|Sql2017|Sql2019|Sql2022|AzureV12"/>
<Property Name="LedgerType" ValidFor="Sql2022|AzureV12"/>
<Property Name="IsExternal" ValidFor="Sql2016|Sql2017|Sql2019|Sql2022|AzureV12|SqlOnDemand"/>
<Property Name="IsEdge" ValidFor="Sql2017|Sql2019|Sql2022|AzureV12"/>
<Property Name="IsNode" ValidFor="Sql2017|Sql2019|Sql2022|AzureV12"/>
</Properties>
<Child Name="SystemTables" IsSystemObject="1"/>
<Child Name="ExternalTables"/>