Add Table Menu for SQL Bindings promptForObjectName (#19358)

* first wip for table menu prompt

* fix up some table prompts

* use simpleExecuteRequest

* fix table prompt scenario for sql binding also

* fix/add more testing and address comments

* add brackets to selected database

* add manually entered option
This commit is contained in:
Vasu Bhog
2022-05-18 14:51:45 -07:00
committed by GitHub
parent 1210bceded
commit 8967ec36f4
10 changed files with 271 additions and 83 deletions

View File

@@ -7,6 +7,7 @@
declare module 'sql-bindings' {
import * as vscode from 'vscode';
import { IConnectionInfo } from 'vscode-mssql';
export const enum extension {
name = 'Microsoft.sql-bindings',
@@ -36,14 +37,20 @@ declare module 'sql-bindings' {
/**
* Prompts the user to enter object name for the SQL query
* @param bindingType Type of SQL Binding
* @param connectionInfo (optional) connection info from the selected connection profile
* if left undefined we prompt to manually enter the object name
* @returns the object name from user's input or menu choice
*/
promptForObjectName(bindingType: BindingType): Promise<string | undefined>;
promptForObjectName(bindingType: BindingType, connectionInfo?: IConnectionInfo): Promise<string | undefined>;
/**
* Prompts the user to enter connection setting and updates it from AF project
* @param projectUri Azure Function project uri
*/
promptAndUpdateConnectionStringSetting(projectUri: vscode.Uri | undefined): Promise<string | undefined>;
* @param connectionInfo (optional) connection info from the user to update the connection string,
* if left undefined we prompt the user for the connection info
* @returns connection string setting name to be used for the createFunction API
*/
promptAndUpdateConnectionStringSetting(projectUri: vscode.Uri | undefined, connectionInfo?: IConnectionInfo): Promise<IConnectionStringInfo | undefined>;
/**
* Gets the names of the Azure Functions in the file
@@ -119,4 +126,12 @@ declare module 'sql-bindings' {
azureFunctions: string[];
}
/**
* Result from promptAndUpdateConnectionStringSetting
*/
export interface IConnectionStringInfo {
connectionStringSettingName: string;
connectionInfo: IConnectionInfo | undefined;
}
}