mirror of
https://github.com/ckaczor/sqltoolsservice.git
synced 2026-01-14 01:25:40 -05:00
Exclude isLedger property check for Azure DBs for improving OE nodes expansion perf (#1798)
This commit is contained in:
@@ -4,8 +4,11 @@
|
||||
//
|
||||
|
||||
using System.Collections.Generic;
|
||||
using Microsoft.SqlTools.Utility;
|
||||
using Microsoft.SqlServer.Management.Smo;
|
||||
using Microsoft.SqlTools.ServiceLayer.ObjectExplorer.Nodes;
|
||||
using System.Diagnostics;
|
||||
using System;
|
||||
|
||||
namespace Microsoft.SqlTools.ServiceLayer.ObjectExplorer.SmoModel
|
||||
{
|
||||
@@ -35,14 +38,15 @@ namespace Microsoft.SqlTools.ServiceLayer.ObjectExplorer.SmoModel
|
||||
try
|
||||
{
|
||||
Database? db = smoObject as Database;
|
||||
if (db != null && IsPropertySupported("IsLedger", smoContext, db, CachedSmoProperties) && db.IsLedger)
|
||||
if (db != null && IsPropertySupported(nameof(db.IsLedger), smoContext, db, CachedSmoProperties) && db.IsLedger)
|
||||
{
|
||||
return "Ledger";
|
||||
}
|
||||
}
|
||||
catch
|
||||
catch (Exception e)
|
||||
{
|
||||
//Ignore the exception and just not change create custom name
|
||||
Logger.Write(TraceEventType.Verbose, $"Error ignored when reading node subtype: {e.Message}");
|
||||
}
|
||||
|
||||
return string.Empty;
|
||||
|
||||
@@ -213,6 +213,11 @@ namespace Microsoft.SqlTools.ServiceLayer.ObjectExplorer.SmoModel
|
||||
Name = "Status",
|
||||
ValidFor = ValidForFlag.All
|
||||
});
|
||||
properties.Add(new NodeSmoProperty
|
||||
{
|
||||
Name = "IsLedger",
|
||||
ValidFor = ValidForFlag.AllOnPrem
|
||||
});
|
||||
return properties;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -11,6 +11,9 @@
|
||||
</Filters>
|
||||
<Properties>
|
||||
<Property Name="Status" ValidFor="All"/>
|
||||
<!--IsLedger property check is disabled on Azure databases to avoid making connections to databases individually
|
||||
when listing databases in Object Explorer since it's value is not available from 'master' DB for all databases.-->
|
||||
<Property Name="IsLedger" ValidFor="AllOnPrem"/>
|
||||
</Properties>
|
||||
<Child Name="SystemDatabases" IsSystemObject="1"/>
|
||||
</Node>
|
||||
|
||||
Reference in New Issue
Block a user