Add findNodes Object Explorer API (#916)

This commit is contained in:
Matt Irvine
2018-03-16 13:37:24 -07:00
committed by GitHub
parent 75ab5c1a36
commit 38bedea0bd
9 changed files with 72 additions and 0 deletions

27
src/sql/sqlops.d.ts vendored
View File

@@ -129,6 +129,18 @@ declare module 'sqlops' {
*/
export function getActiveConnectionNodes(): Thenable<ObjectExplorerNode[]>;
/**
* Find Object Explorer nodes that match the given information
* @param {string} connectionId The id of the connection that the node exists on
* @param {string} type The type of the object to retrieve
* @param {string} schema The schema of the object, if applicable
* @param {string} name The name of the object
* @param {string} database The database the object exists under, if applicable
* @param {string[]} parentObjectNames A list of names of parent objects in the tree, ordered from highest to lowest level
* (for example when searching for a table's column, provide the name of its parent table for this argument)
*/
export function findNodes(connectionId: string, type: string, schema: string, name: string, database: string, parentObjectNames: string[]): Thenable<ObjectExplorerNode[]>;
/**
* Interface for representing and interacting with items in Object Explorer
*/
@@ -942,6 +954,15 @@ declare module 'sqlops' {
nodePath: string;
}
export interface FindNodesInfo {
sessionId: string;
type: string;
schema: string;
name: string;
database: string;
parentObjectNames: string[];
}
export interface ObjectExplorerCloseSessionInfo {
sessionId: string;
}
@@ -951,6 +972,10 @@ declare module 'sqlops' {
success: boolean;
}
export interface ObjectExplorerFindNodesResponse {
nodes: NodeInfo[];
}
export interface ObjectExplorerProvider extends DataProvider {
createNewSession(connInfo: ConnectionInfo): Thenable<ObjectExplorerSessionResponse>;
@@ -960,6 +985,8 @@ declare module 'sqlops' {
closeSession(closeSessionInfo: ObjectExplorerCloseSessionInfo): Thenable<ObjectExplorerCloseSessionResponse>;
findNodes(findNodesInfo: FindNodesInfo): Thenable<ObjectExplorerFindNodesResponse>;
registerOnSessionCreated(handler: (response: ObjectExplorerSession) => any);
registerOnExpandCompleted(handler: (response: ObjectExplorerExpandInfo) => any);