Add sql bindings package reference to project (#16912)

* list packages and add packages working

* cleanup and remove list packages

* cleanup

* change to pull in latest package version
This commit is contained in:
Kim Santiago
2021-08-27 16:58:54 -07:00
committed by GitHub
parent 22141259d3
commit 2c75f199e8
5 changed files with 134 additions and 2 deletions

View File

@@ -444,7 +444,9 @@ export function getTargetPlatformFromVersion(version: string): string {
// Insert SQL binding
export const hostFileName = 'host.json';
export const sqlExtensionPackageName = 'Microsoft.Azure.WebJobs.Extensions.Sql';
export const placeHolderObject = '[dbo].[table1]';
export const input = localize('input', "Input");
export const output = localize('output', "Output");
export const selectBindingType = localize('selectBindingType', "Select type of binding");
@@ -454,3 +456,5 @@ export const sqlTableToUpsert = localize('sqlTableToUpsert', "SQL table to upser
export const connectionStringSetting = localize('connectionStringSetting', "Connection string setting name");
export const connectionStringSettingPlaceholder = localize('connectionStringSettingPlaceholder', "Connection string setting specified in \"local.settings.json\"");
export const noAzureFunctionsInFile = localize('noAzureFunctionsInFile', "No Azure functions in the current active file");
export const noAzureFunctionsProjectsInWorkspace = localize('noAzureFunctionsProjectsInWorkspace', "No Azure functions projects found in the workspace");
export const addPackage = localize('addPackage', "Add Package");

View File

@@ -488,3 +488,20 @@ export async function retry<T>(
return undefined;
}
/**
* Gets all the projects of the specified extension in the folder
* @param folder
* @param projectExtension project extension to filter on
* @returns array of project uris
*/
export async function getAllProjectsInFolder(folder: vscode.Uri, projectExtension: string): Promise<vscode.Uri[]> {
// path needs to use forward slashes for glob to work
const escapedPath = glob.escapePath(folder.fsPath.replace(/\\/g, '/'));
// filter for projects with the specified project extension
const projFilter = path.posix.join(escapedPath, '**', `*${projectExtension}`);
// glob will return an array of file paths with forward slashes, so they need to be converted back if on windows
return (await glob(projFilter)).map(p => vscode.Uri.file(path.resolve(p)));
}