hook up add sql binding (#16838)

* hookup add sql binding

* fix typo

* addressing comments

* Addressing more comments

* add more comments
This commit is contained in:
Kim Santiago
2021-08-23 13:49:05 -07:00
committed by GitHub
parent 02dbac3b5f
commit b2be609c36
4 changed files with 147 additions and 26 deletions

View File

@@ -39,6 +39,11 @@ declare module 'vscode-mssql' {
*/
readonly schemaCompare: ISchemaCompareService;
/**
* Service for accessing AzureFunctions functionality
*/
readonly azureFunctions: IAzureFunctionsService;
/**
* Prompts the user to select an existing connection or create a new one, and then returns the result
* @param ignoreFocusOut Whether the quickpick prompt ignores focus out (default false)
@@ -51,7 +56,7 @@ declare module 'vscode-mssql' {
* @param connectionInfo The connection info
* @returns The URI associated with this connection
*/
connect(connectionInfo: IConnectionInfo): Promise<string>;
connect(connectionInfo: IConnectionInfo): Promise<string>;
/**
* Lists the databases for a given connection. Must be given an already-opened connection to succeed.
@@ -73,7 +78,7 @@ declare module 'vscode-mssql' {
/**
* Information about a database connection
*/
export interface IConnectionInfo {
export interface IConnectionInfo {
/**
* server name
*/
@@ -258,6 +263,24 @@ declare module 'vscode-mssql' {
validateStreamingJob(packageFilePath: string, createStreamingJobTsql: string): Thenable<ValidateStreamingJobResult>;
}
export interface IAzureFunctionsService {
/**
* Adds a SQL Binding to a specified Azure function in a file
* @param bindingType Type of SQL Binding
* @param filePath Path of the file where the Azure Functions are
* @param functionName Name of the function where the SQL Binding is to be added
* @param objectName Name of Object for the SQL Query
* @param connectionStringSetting Setting for the connection string
*/
addSqlBinding(bindingType: BindingType, filePath: string, functionName: string, objectName: string, connectionStringSetting: string): Thenable<ResultStatus>;
/**
* Gets the names of the Azure functions in the file
* @param filePath Path of the file to get the Azure functions
* @returns array of names of Azure functions in the file
*/
getAzureFunctions(filePath: string): Thenable<GetAzureFunctionsResult>;
}
export const enum TaskExecutionMode {
execute = 0,
script = 1,
@@ -532,4 +555,62 @@ declare module 'vscode-mssql' {
schema: string;
}
/**
* Azure functions binding type
*/
export const enum BindingType {
input,
output
}
/**
* Parameters for adding a SQL binding to an Azure function
*/
export interface AddSqlBindingParams {
/**
* Aboslute file path of file to add SQL binding
*/
filePath: string;
/**
* Name of function to add SQL binding
*/
functionName: string;
/**
* Name of object to use in SQL binding
*/
objectName: string;
/**
* Type of Azure function binding
*/
bindingType: BindingType;
/**
* Name of SQL connection string setting specified in local.settings.json
*/
connectionStringSetting: string;
}
/**
* Parameters for getting the names of the Azure functions in a file
*/
export interface GetAzureFunctionsParams {
/**
* Absolute file path of file to get Azure functions
*/
filePath: string;
}
/**
* Result from a get Azure functions request
*/
export interface GetAzureFunctionsResult extends ResultStatus {
/**
* Array of names of Azure functions in the file
*/
azureFunctions: string[];
}
}