mirror of
https://github.com/ckaczor/sqltoolsservice.git
synced 2026-02-16 10:58:30 -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 System.Collections.Generic;
|
||||||
|
using Microsoft.SqlTools.Utility;
|
||||||
using Microsoft.SqlServer.Management.Smo;
|
using Microsoft.SqlServer.Management.Smo;
|
||||||
using Microsoft.SqlTools.ServiceLayer.ObjectExplorer.Nodes;
|
using Microsoft.SqlTools.ServiceLayer.ObjectExplorer.Nodes;
|
||||||
|
using System.Diagnostics;
|
||||||
|
using System;
|
||||||
|
|
||||||
namespace Microsoft.SqlTools.ServiceLayer.ObjectExplorer.SmoModel
|
namespace Microsoft.SqlTools.ServiceLayer.ObjectExplorer.SmoModel
|
||||||
{
|
{
|
||||||
@@ -35,14 +38,15 @@ namespace Microsoft.SqlTools.ServiceLayer.ObjectExplorer.SmoModel
|
|||||||
try
|
try
|
||||||
{
|
{
|
||||||
Database? db = smoObject as Database;
|
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";
|
return "Ledger";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
catch
|
catch (Exception e)
|
||||||
{
|
{
|
||||||
//Ignore the exception and just not change create custom name
|
//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;
|
return string.Empty;
|
||||||
|
|||||||
@@ -213,6 +213,11 @@ namespace Microsoft.SqlTools.ServiceLayer.ObjectExplorer.SmoModel
|
|||||||
Name = "Status",
|
Name = "Status",
|
||||||
ValidFor = ValidForFlag.All
|
ValidFor = ValidForFlag.All
|
||||||
});
|
});
|
||||||
|
properties.Add(new NodeSmoProperty
|
||||||
|
{
|
||||||
|
Name = "IsLedger",
|
||||||
|
ValidFor = ValidForFlag.AllOnPrem
|
||||||
|
});
|
||||||
return properties;
|
return properties;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -11,6 +11,9 @@
|
|||||||
</Filters>
|
</Filters>
|
||||||
<Properties>
|
<Properties>
|
||||||
<Property Name="Status" ValidFor="All"/>
|
<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>
|
</Properties>
|
||||||
<Child Name="SystemDatabases" IsSystemObject="1"/>
|
<Child Name="SystemDatabases" IsSystemObject="1"/>
|
||||||
</Node>
|
</Node>
|
||||||
|
|||||||
Reference in New Issue
Block a user