Fix uplevel SQL Server support and differentiate External and FileTable types in object explorer list (#567)

* Differentiate External and FileTable types in object explorer list
- Add (External) and (File Table) to the labels
- Pre-fetch these properties to avoid perf hit

Note on testing: These are both quite hard to initialize, so adding tests to the integration tests would require always having a server with Polybase enabled / FileTable enabled. Given this I feel it should be OK to use manual testing. Long term, we should have unit-level tests that cover the functionality or figure out how to have a perfect pre-configured server and a set of tests to run the breadth of this logic against it.

* Fix handling of vNext servers to default to latest known version
- Default uplevel / unknown versions to the latest version
- In the IsValidFor check also just see if the server version registers as "All" since this is the default for unknown servers. This is a backup handler, the 1st fix is the primary one
This commit is contained in:
Kevin Cunnane
2017-12-08 17:52:49 -08:00
committed by GitHub
parent b51608f022
commit 392325036e
19 changed files with 5723 additions and 5647 deletions

View File

@@ -21,6 +21,14 @@ namespace Microsoft.SqlTools.ServiceLayer.ObjectExplorer.SmoModel
{
return $"{table.Schema}.{table.Name} ({SR.SystemVersioned_LabelPart})";
}
else if (table != null && IsPropertySupported("IsExternal", smoContext, table, CachedSmoProperties) && table.IsExternal)
{
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})";
}
}
catch
{
@@ -39,6 +47,11 @@ namespace Microsoft.SqlTools.ServiceLayer.ObjectExplorer.SmoModel
{
return "Temporal";
}
// 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;
}

View File

@@ -79,8 +79,10 @@
</Filter>
</Filters>
<Properties>
<Property Name="IsFileTable" ValidFor="Sql2012|Sql2014|Sql2016|Sql2017"/>
<Property Name="IsSystemVersioned" ValidFor="Sql2016|Sql2017|AzureV12"/>
<Property Name="TemporalType" ValidFor="Sql2016|Sql2017|AzureV12"/>
<Property Name="IsExternal" ValidFor="Sql2016|Sql2017|AzureV12"/>
</Properties>
<Child Name="SystemTables" IsSystemObject="1"/>
</Node>