diff --git a/src/Microsoft.SqlTools.ServiceLayer/ObjectExplorer/Nodes/ChildFactory.cs b/src/Microsoft.SqlTools.ServiceLayer/ObjectExplorer/Nodes/ChildFactory.cs
index 12e24595..45e9cd9b 100644
--- a/src/Microsoft.SqlTools.ServiceLayer/ObjectExplorer/Nodes/ChildFactory.cs
+++ b/src/Microsoft.SqlTools.ServiceLayer/ObjectExplorer/Nodes/ChildFactory.cs
@@ -71,5 +71,11 @@ namespace Microsoft.SqlTools.ServiceLayer.ObjectExplorer.Nodes
// TODO Consider whether Remove operations need to be supported
//public abstract bool CanRemoveChild(TreeNode parent, object context);
//public abstract int GetChildIndexToRemove(TreeNode parent, object context);
+
+ ///
+ /// A flag that puts child folders after nodes when the node is expanded.
+ ///
+ ///
+ public virtual bool PutFoldersAfterNodes => false;
}
}
diff --git a/src/Microsoft.SqlTools.ServiceLayer/ObjectExplorer/Nodes/INodeFilter.cs b/src/Microsoft.SqlTools.ServiceLayer/ObjectExplorer/Nodes/INodeFilter.cs
index d597f7c5..54668c41 100644
--- a/src/Microsoft.SqlTools.ServiceLayer/ObjectExplorer/Nodes/INodeFilter.cs
+++ b/src/Microsoft.SqlTools.ServiceLayer/ObjectExplorer/Nodes/INodeFilter.cs
@@ -3,11 +3,9 @@
// Licensed under the MIT license. See LICENSE file in the project root for full license information.
//
-#nullable disable
-
using System;
using System.Collections.Generic;
-//using System.Linq;
+using System.Linq;
using System.Text;
namespace Microsoft.SqlTools.ServiceLayer.ObjectExplorer.Nodes
@@ -44,7 +42,8 @@ namespace Microsoft.SqlTools.ServiceLayer.ObjectExplorer.Nodes
{
string andPrefix = filter.Length == 0 ? string.Empty : " and ";
var filterString = value.ToPropertyFilterString(type, validForFlag);
- if (filterString != string.Empty) {
+ if (filterString != string.Empty)
+ {
filter.Append($"{andPrefix}{filterString}");
}
}
@@ -55,5 +54,25 @@ namespace Microsoft.SqlTools.ServiceLayer.ObjectExplorer.Nodes
}
return string.Empty;
}
+
+ ///
+ /// Appends a list of property filters to an URN query string
+ ///
+ public static string AddPropertyFilterToFilterString(string filterString, IEnumerable filters, Type type, ValidForFlag validForFlag)
+ {
+ if (string.IsNullOrEmpty(filterString))
+ {
+ return GetPropertyFilter(filters, type, validForFlag);
+ }
+ foreach (var value in filters ?? Enumerable.Empty())
+ {
+ var filter = value.ToPropertyFilterString(type, validForFlag);
+ if (filter != string.Empty)
+ {
+ filterString = filterString.Remove(filterString.Length - 1, 1) + $" and {filter}" + "]";
+ }
+ }
+ return filterString;
+ }
}
}
diff --git a/src/Microsoft.SqlTools.ServiceLayer/ObjectExplorer/Nodes/NodeTypes.cs b/src/Microsoft.SqlTools.ServiceLayer/ObjectExplorer/Nodes/NodeTypes.cs
index 14fcc15a..aa491571 100644
--- a/src/Microsoft.SqlTools.ServiceLayer/ObjectExplorer/Nodes/NodeTypes.cs
+++ b/src/Microsoft.SqlTools.ServiceLayer/ObjectExplorer/Nodes/NodeTypes.cs
@@ -1,147 +1,142 @@
-//
+//
// Copyright (c) Microsoft. All rights reserved.
// Licensed under the MIT license. See LICENSE file in the project root for full license information.
//
+// This file was generated by a T4 Template. Do not modify directly, instead update the SmoTreeNodesDefinition.xml file
+// and re-run the T4 template. This can be done in Visual Studio by right-click in and choosing "Run Custom Tool",
+// or from the command-line on any platform by running "build.cmd -Target=CodeGen" or "build.sh -Target=CodeGen"
+
namespace Microsoft.SqlTools.ServiceLayer.ObjectExplorer.Nodes
{
///
/// Enum listing possible node types in the object explorer tree
///
- // TODO Consider replacing this with an auto-gen'd version
public enum NodeTypes
{
- None,
- SqlServersRoot,
- Database,
- Server,
- ScalarValuedFunction,
- TableValuedFunction,
AggregateFunction,
- FileGroup,
- StoredProcedure,
- UserDefinedTableType,
- View,
- Table,
- HistoryTable,
- Folder,
- Databases,
- ExternalResources,
- ServerLevelSecurity,
- ServerLevelServerObjects,
- ServerLevelManagement,
- SystemDatabases,
- ServerLevelLinkedServerLogins,
- ServerLevelServerAudits,
- ServerLevelCryptographicProviders,
- ServerLevelCredentials,
- ServerLevelServerRoles,
- ServerLevelLogins,
- ServerLevelEventSessions,
- ServerLevelServerAuditSpecifications,
- ServerLevelEventNotifications,
- ServerLevelErrorMessages,
- ServerLevelServerTriggers,
- ServerLevelLinkedServers,
- ServerLevelEndpoints,
- SystemScalarValuedFunctions,
- SystemTableValuedFunctions,
- SystemFunctions,
- DacInstancesFolder,
- Tables,
- Views,
- Synonyms,
- Programmability,
- ServiceBroker,
- Storage,
- Security,
- SystemTables,
- FileTables,
- SystemViews,
- StoredProcedures,
- Functions,
- ExtendedStoredProcedures,
- DatabaseTriggers,
- Defaults,
- Rules,
- Types,
- Assemblies,
- MessageTypes,
- Contracts,
- Queues,
- Services,
- Routes,
- DatabaseAndQueueEventNotifications,
- RemoteServiceBindings,
- BrokerPriorities,
- FileGroups,
- FullTextCatalogs,
- FullTextStopLists,
- SqlLogFiles,
- PartitionFunctions,
- PartitionSchemes,
- SearchPropertyLists,
- Users,
- Roles,
- Schemas,
- AsymmetricKeys,
- Certificates,
- SymmetricKeys,
- DatabaseEncryptionKeys,
- MasterKeys,
- Signatures,
- DatabaseAuditSpecifications,
- Columns,
- Keys,
- Constraints,
- Triggers,
- Indexes,
- Statistics,
- TableValuedFunctions,
- ScalarValuedFunctions,
- AggregateFunctions,
- SystemDataTypes,
- UserDefinedDataTypes,
- UserDefinedTableTypes,
- UserDefinedTypes,
- XmlSchemaCollections,
- SystemExactNumerics,
- SystemApproximateNumerics,
- SystemDateAndTimes,
- SystemCharacterStrings,
- SystemUnicodeCharacterStrings,
- SystemBinaryStrings,
- SystemOtherDataTypes,
- SystemClrDataTypes,
- SystemSpatialDataTypes,
- UserDefinedTableTypeColumns,
- UserDefinedTableTypeKeys,
- UserDefinedTableTypeConstraints,
- SystemStoredProcedures,
- StoredProcedureParameters,
- TableValuedFunctionParameters,
- ScalarValuedFunctionParameters,
AggregateFunctionParameters,
- DatabaseRoles,
- ApplicationRoles,
- FileGroupFiles,
- SystemMessageTypes,
- SystemContracts,
- SystemServices,
- SystemQueues,
- Sequences,
- SecurityPolicies,
- DatabaseScopedCredentials,
- ExternalTables,
- ExternalResource,
- ExternalDataSources,
- ExternalFileFormats,
- ExternalTable,
+ AggregateFunctions,
AlwaysEncryptedKeys,
- ColumnMasterKeys,
+ ApplicationRoles,
+ Assemblies,
+ AsymmetricKeys,
+ BrokerPriorities,
+ Certificates,
ColumnEncryptionKeys,
+ ColumnMasterKeys,
+ Columns,
+ Constraints,
+ Contracts,
+ Database,
+ DatabaseAndQueueEventNotifications,
+ DatabaseAuditSpecifications,
+ DatabaseEncryptionKeys,
+ DatabaseRoles,
+ Databases,
+ DatabaseScopedCredentials,
+ DatabaseTriggers,
+ DroppedLedgerColumns,
DroppedLedgerTables,
DroppedLedgerViews,
- DroppedLedgerColumns,
+ ExpandableSchema,
+ ExpandableSchemaProgrammability,
+ ExternalDataSources,
+ ExternalFileFormats,
+ ExternalResource,
+ ExternalResources,
+ ExternalTable,
+ ExternalTables,
+ FileGroup,
+ FileGroupFiles,
+ FileGroups,
+ Folder,
+ FullTextCatalogs,
+ FullTextStopLists,
+ Functions,
+ HistoryTable,
+ Indexes,
+ Keys,
+ MasterKeys,
+ MessageTypes,
+ PartitionFunctions,
+ PartitionSchemes,
+ Programmability,
+ Queues,
+ RemoteServiceBindings,
+ Roles,
+ ScalarValuedFunction,
+ ScalarValuedFunctionParameters,
+ ScalarValuedFunctions,
+ Schemas,
+ SearchPropertyLists,
+ Security,
+ SecurityPolicies,
+ Sequences,
+ Server,
+ ServerLevelCredentials,
+ ServerLevelCryptographicProviders,
+ ServerLevelEndpoints,
+ ServerLevelErrorMessages,
+ ServerLevelLinkedServerLogins,
+ ServerLevelLinkedServers,
+ ServerLevelLogins,
+ ServerLevelSecurity,
+ ServerLevelServerAudits,
+ ServerLevelServerAuditSpecifications,
+ ServerLevelServerObjects,
+ ServerLevelServerRoles,
+ ServerLevelServerTriggers,
+ ServiceBroker,
+ Services,
+ Signatures,
+ SqlLogFiles,
+ Statistics,
+ Storage,
+ StoredProcedure,
+ StoredProcedureParameters,
+ StoredProcedures,
+ SymmetricKeys,
+ Synonyms,
+ SystemApproximateNumerics,
+ SystemBinaryStrings,
+ SystemCharacterStrings,
+ SystemClrDataTypes,
+ SystemContracts,
+ SystemDatabases,
+ SystemDataTypes,
+ SystemDateAndTimes,
+ SystemExactNumerics,
+ SystemFunctions,
+ SystemMessageTypes,
+ SystemOtherDataTypes,
+ SystemQueues,
+ SystemScalarValuedFunctions,
+ SystemServices,
+ SystemSpatialDataTypes,
+ SystemStoredProcedures,
+ SystemTables,
+ SystemTableValuedFunctions,
+ SystemUnicodeCharacterStrings,
+ SystemViews,
+ Table,
+ Tables,
+ TableValuedFunction,
+ TableValuedFunctionParameters,
+ TableValuedFunctions,
+ Triggers,
+ Types,
+ UserDefinedDataTypes,
+ UserDefinedTableType,
+ UserDefinedTableTypeColumns,
+ UserDefinedTableTypeConstraints,
+ UserDefinedTableTypeKeys,
+ UserDefinedTableTypes,
+ UserDefinedTypes,
+ Users,
+ View,
+ Views,
+ XmlSchemaCollections,
}
}
+
diff --git a/src/Microsoft.SqlTools.ServiceLayer/ObjectExplorer/Nodes/NodeTypes.tt b/src/Microsoft.SqlTools.ServiceLayer/ObjectExplorer/Nodes/NodeTypes.tt
new file mode 100644
index 00000000..2b2a5efc
--- /dev/null
+++ b/src/Microsoft.SqlTools.ServiceLayer/ObjectExplorer/Nodes/NodeTypes.tt
@@ -0,0 +1,117 @@
+<#@ template debug="false" hostspecific="true" language="C#" #>
+<#@ output extension=".cs" #>
+<#@ assembly name="System.Xml.dll" #>
+<#@ assembly name="System.Core.dll" #>
+<#@ import namespace="System" #>
+<#@ import namespace="System.Globalization" #>
+<#@ import namespace="System.Text" #>
+<#@ import namespace="System.Xml" #>
+<#@ import namespace="System.Collections.Generic" #>
+<#@ import namespace="System.IO" #>
+<#@ import namespace="System.Linq"#>
+//
+// Copyright (c) Microsoft. All rights reserved.
+// Licensed under the MIT license. See LICENSE file in the project root for full license information.
+//
+
+// This file was generated by a T4 Template. Do not modify directly, instead update the SmoTreeNodesDefinition.xml file
+// and re-run the T4 template. This can be done in Visual Studio by right-click in and choosing "Run Custom Tool",
+// or from the command-line on any platform by running "build.cmd -Target=CodeGen" or "build.sh -Target=CodeGen"
+
+namespace Microsoft.SqlTools.ServiceLayer.ObjectExplorer.Nodes
+{
+ ///
+ /// Enum listing possible node types in the object explorer tree
+ ///
+ public enum NodeTypes
+ {
+<#
+ var directory = Path.GetDirectoryName(Host.TemplateFile);
+
+ string xmlFile = Path.Combine(directory, "..\\SmoModel\\SmoTreeNodesDefinition.xml");
+
+ var allTreeNodes = GetUniqueNodeTypes(xmlFile);
+
+ foreach (var name in allTreeNodes)
+ {
+ WriteLine(" {0},", name);
+ }
+
+#>
+ }
+}
+
+<#+
+ public static List GetUniqueNodeTypes(string xmlFile)
+ {
+ XmlDocument doc = new XmlDocument();
+ doc.Load(xmlFile);
+
+
+ // Adding all node types
+ HashSet retElements = new HashSet();
+ XmlNodeList nodeList = doc.SelectNodes("/ServerExplorerTree/Node");
+ foreach (XmlElement item in nodeList)
+ {
+ retElements.Add(item.GetAttribute("Name"));
+ foreach (XmlElement child in GetChildren(xmlFile, item.GetAttribute("Name")))
+ {
+ retElements.Add(child.GetAttribute("Name"));
+ }
+ }
+
+ // Adding UniqueTreeNodes
+ foreach(var name in GetUniqueTreeNodes(xmlFile))
+ {
+ retElements.Add(name);
+ }
+
+ // Adding types that are not present anywhere. These types are referred in tests.
+ retElements.Add("Folder");
+
+ var retList = retElements.ToList();
+ retList.Sort();
+ return retList;
+ }
+
+ public static List GetChildren(string xmlFile, string parentName)
+ {
+ XmlElement nodeElement = GetNodeElement(xmlFile, parentName);
+ XmlDocument doc = new XmlDocument();
+ doc.Load(xmlFile);
+
+ List retElements = new List();
+ XmlNodeList nodeList = doc.SelectNodes(string.Format("/ServerExplorerTree/Node[@Name='{0}']/Child", parentName));
+ foreach (var item in nodeList)
+ {
+ XmlElement itemAsElement = item as XmlElement;
+ if (itemAsElement != null)
+ {
+ retElements.Add(itemAsElement);
+ }
+ }
+ return retElements;
+ }
+
+ public static XmlElement GetNodeElement(string xmlFile, string nodeName)
+ {
+ XmlDocument doc = new XmlDocument();
+ doc.Load(xmlFile);
+ return (XmlElement)doc.SelectSingleNode(string.Format("/ServerExplorerTree/Node[@Name='{0}']", nodeName));
+ }
+
+ public static List GetUniqueTreeNodes(string xmlFile)
+ {
+ XmlDocument doc = new XmlDocument();
+ doc.Load(xmlFile);
+
+ List retElements = new List();
+ XmlNodeList nodeList = doc.SelectNodes("/ServerExplorerTree/CodeGenOptions/UniqueTreeNode");
+ foreach (XmlElement item in nodeList)
+ {
+ retElements.Add(item.GetAttribute("Name").Replace("TreeNode", string.Empty));
+
+ }
+ return retElements;
+ }
+#>
\ No newline at end of file
diff --git a/src/Microsoft.SqlTools.ServiceLayer/ObjectExplorer/SmoModel/FolderNode.cs b/src/Microsoft.SqlTools.ServiceLayer/ObjectExplorer/SmoModel/FolderNode.cs
index 11ac8e8e..ede6aba9 100644
--- a/src/Microsoft.SqlTools.ServiceLayer/ObjectExplorer/SmoModel/FolderNode.cs
+++ b/src/Microsoft.SqlTools.ServiceLayer/ObjectExplorer/SmoModel/FolderNode.cs
@@ -6,6 +6,7 @@
#nullable disable
using Microsoft.SqlServer.Management.Smo;
+using Microsoft.SqlTools.ServiceLayer.ObjectExplorer.Nodes;
namespace Microsoft.SqlTools.ServiceLayer.ObjectExplorer.SmoModel
{
@@ -14,6 +15,11 @@ namespace Microsoft.SqlTools.ServiceLayer.ObjectExplorer.SmoModel
///
public class FolderNode : SmoTreeNode
{
+
+ public FolderNode()
+ {
+ this.NodeType = nameof(NodeTypes.Folder);
+ }
///
/// For folders, this copies the context of its parent if available
///
diff --git a/src/Microsoft.SqlTools.ServiceLayer/ObjectExplorer/SmoModel/NodePathGenerator.cs b/src/Microsoft.SqlTools.ServiceLayer/ObjectExplorer/SmoModel/NodePathGenerator.cs
index 25cebb98..85caccbf 100644
--- a/src/Microsoft.SqlTools.ServiceLayer/ObjectExplorer/SmoModel/NodePathGenerator.cs
+++ b/src/Microsoft.SqlTools.ServiceLayer/ObjectExplorer/SmoModel/NodePathGenerator.cs
@@ -125,7 +125,7 @@ namespace Microsoft.SqlTools.ServiceLayer.ObjectExplorer.SmoModel
else
{
var returnSet = new HashSet();
- if (currentNode.ContainedType() == "Database")
+ if (currentNode.ContainedType() == "Database" || currentNode.ContainedType() == "ExpandableSchema")
{
path = databaseName + "/" + path;
}
diff --git a/src/Microsoft.SqlTools.ServiceLayer/ObjectExplorer/SmoModel/SmoChildFactoryBase.cs b/src/Microsoft.SqlTools.ServiceLayer/ObjectExplorer/SmoModel/SmoChildFactoryBase.cs
index dc491bcc..73b075b8 100644
--- a/src/Microsoft.SqlTools.ServiceLayer/ObjectExplorer/SmoModel/SmoChildFactoryBase.cs
+++ b/src/Microsoft.SqlTools.ServiceLayer/ObjectExplorer/SmoModel/SmoChildFactoryBase.cs
@@ -31,14 +31,24 @@ namespace Microsoft.SqlTools.ServiceLayer.ObjectExplorer.SmoModel
try
{
- OnExpandPopulateFoldersAndFilter(allChildren, parent, includeSystemObjects);
- RemoveFoldersFromInvalidSqlServerVersions(allChildren, parent);
- OnExpandPopulateNonFolders(allChildren, parent, refresh, name, cancellationToken);
+ if (this.PutFoldersAfterNodes)
+ {
+ OnExpandPopulateNonFolders(allChildren, parent, refresh, name, cancellationToken);
+ OnExpandPopulateFoldersAndFilter(allChildren, parent, includeSystemObjects);
+ RemoveFoldersFromInvalidSqlServerVersions(allChildren, parent);
+ }
+ else
+ {
+ OnExpandPopulateFoldersAndFilter(allChildren, parent, includeSystemObjects);
+ RemoveFoldersFromInvalidSqlServerVersions(allChildren, parent);
+ OnExpandPopulateNonFolders(allChildren, parent, refresh, name, cancellationToken);
+ }
+
OnBeginAsyncOperations(parent);
}
- catch(Exception ex)
+ catch (Exception ex)
{
- string error = string.Format(CultureInfo.InvariantCulture, "Failed expanding oe children. parent:{0} error:{1} inner:{2} stacktrace:{3}",
+ string error = string.Format(CultureInfo.InvariantCulture, "Failed expanding oe children. parent:{0} error:{1} inner:{2} stacktrace:{3}",
parent != null ? parent.GetNodePath() : "", ex.Message, ex.InnerException != null ? ex.InnerException.Message : "", ex.StackTrace);
Logger.Write(TraceEventType.Error, error);
throw;
diff --git a/src/Microsoft.SqlTools.ServiceLayer/ObjectExplorer/SmoModel/SmoQueryModel.cs b/src/Microsoft.SqlTools.ServiceLayer/ObjectExplorer/SmoModel/SmoQueryModel.cs
index 89bb233d..7a6c311a 100644
--- a/src/Microsoft.SqlTools.ServiceLayer/ObjectExplorer/SmoModel/SmoQueryModel.cs
+++ b/src/Microsoft.SqlTools.ServiceLayer/ObjectExplorer/SmoModel/SmoQueryModel.cs
@@ -15,6 +15,7 @@ using System.Composition;
using System.Linq;
using Microsoft.SqlServer.Management.Smo;
using Microsoft.SqlServer.Management.Smo.Broker;
+using Microsoft.SqlTools.ServiceLayer.ObjectExplorer.Nodes;
using Microsoft.SqlTools.Utility;
using Index = Microsoft.SqlServer.Management.Smo.Index;
@@ -34,6 +35,7 @@ namespace Microsoft.SqlTools.ServiceLayer.ObjectExplorer.SmoModel
Server parentServer = context.Parent as Server;
if (parentServer != null)
{
+ Logger.Verbose("Parent of type `Server` found");
var retValue = parentServer.Databases;
if (retValue != null)
{
@@ -60,6 +62,7 @@ namespace Microsoft.SqlTools.ServiceLayer.ObjectExplorer.SmoModel
Server parentServer = context.Parent as Server;
if (parentServer != null)
{
+ Logger.Verbose("Parent of type `Server` found");
var retValue = parentServer.LinkedServers;
if (retValue != null)
{
@@ -86,6 +89,7 @@ namespace Microsoft.SqlTools.ServiceLayer.ObjectExplorer.SmoModel
Server parentServer = context.Parent as Server;
if (parentServer != null)
{
+ Logger.Verbose("Parent of type `Server` found");
var retValue = parentServer.Logins;
if (retValue != null)
{
@@ -112,6 +116,7 @@ namespace Microsoft.SqlTools.ServiceLayer.ObjectExplorer.SmoModel
Server parentServer = context.Parent as Server;
if (parentServer != null)
{
+ Logger.Verbose("Parent of type `Server` found");
var retValue = parentServer.Roles;
if (retValue != null)
{
@@ -138,6 +143,7 @@ namespace Microsoft.SqlTools.ServiceLayer.ObjectExplorer.SmoModel
Server parentServer = context.Parent as Server;
if (parentServer != null)
{
+ Logger.Verbose("Parent of type `Server` found");
var retValue = parentServer.Credentials;
if (retValue != null)
{
@@ -164,6 +170,7 @@ namespace Microsoft.SqlTools.ServiceLayer.ObjectExplorer.SmoModel
Server parentServer = context.Parent as Server;
if (parentServer != null)
{
+ Logger.Verbose("Parent of type `Server` found");
var retValue = parentServer.CryptographicProviders;
if (retValue != null)
{
@@ -190,6 +197,7 @@ namespace Microsoft.SqlTools.ServiceLayer.ObjectExplorer.SmoModel
Server parentServer = context.Parent as Server;
if (parentServer != null)
{
+ Logger.Verbose("Parent of type `Server` found");
var retValue = parentServer.Audits;
if (retValue != null)
{
@@ -216,6 +224,7 @@ namespace Microsoft.SqlTools.ServiceLayer.ObjectExplorer.SmoModel
Server parentServer = context.Parent as Server;
if (parentServer != null)
{
+ Logger.Verbose("Parent of type `Server` found");
var retValue = parentServer.ServerAuditSpecifications;
if (retValue != null)
{
@@ -242,6 +251,7 @@ namespace Microsoft.SqlTools.ServiceLayer.ObjectExplorer.SmoModel
Server parentServer = context.Parent as Server;
if (parentServer != null)
{
+ Logger.Verbose("Parent of type `Server` found");
var retValue = parentServer.Endpoints;
if (retValue != null)
{
@@ -268,6 +278,7 @@ namespace Microsoft.SqlTools.ServiceLayer.ObjectExplorer.SmoModel
Server parentServer = context.Parent as Server;
if (parentServer != null)
{
+ Logger.Verbose("Parent of type `Server` found");
var retValue = parentServer.LinkedServers;
if (retValue != null)
{
@@ -297,6 +308,7 @@ namespace Microsoft.SqlTools.ServiceLayer.ObjectExplorer.SmoModel
Server parentServer = context.Parent as Server;
if (parentServer != null)
{
+ Logger.Verbose("Parent of type `Server` found");
var retValue = parentServer.Triggers;
if (retValue != null)
{
@@ -323,6 +335,7 @@ namespace Microsoft.SqlTools.ServiceLayer.ObjectExplorer.SmoModel
Server parentServer = context.Parent as Server;
if (parentServer != null)
{
+ Logger.Verbose("Parent of type `Server` found");
var retValue = parentServer.UserDefinedMessages;
if (retValue != null)
{
@@ -349,6 +362,7 @@ namespace Microsoft.SqlTools.ServiceLayer.ObjectExplorer.SmoModel
Database parentDatabase = context.Parent as Database;
if (parentDatabase != null)
{
+ Logger.Verbose("Parent of type `Database` found");
var retValue = parentDatabase.Tables;
if (retValue != null)
{
@@ -358,6 +372,28 @@ namespace Microsoft.SqlTools.ServiceLayer.ObjectExplorer.SmoModel
return ret;
}
}
+ Schema parentSchema = context.Parent as Schema;
+ if (parentSchema != null)
+ {
+ Logger.Verbose("Parent of type `Schema` found");
+ List filters = new List();
+ filters.Add(new NodePropertyFilter()
+ {
+ Property = nameof(Schema),
+ Type = typeof(string),
+ Values = new List