Compare commits

...

9 Commits

Author SHA1 Message Date
Cheena Malhotra
9fdb2161d4 Update STS version to port SqlClient library update (#20406) 2022-08-18 11:53:03 -07:00
Barbara Valdez
b2ca229e60 Fix unpin notebook (#20393) (#20397)
* convert uri to vscode uri
2022-08-18 08:59:08 -07:00
Vasu Bhog
60037222a0 Ensure SQL Nuget package reference is always updating to latest (#20390) (#20400)
* seperate nuget package references to always update to latest

* nit

* nit comments
2022-08-17 20:43:59 -07:00
Hai Cao
106bb5ecdf update STS in release to port table designer fix (#20394) 2022-08-17 15:26:51 -07:00
Karl Burtram
1bcbb93301 Replace Job Step retry placeholders with values (#20376) (#20388) 2022-08-17 13:21:40 -07:00
Kim Santiago
4fd2d9e76b update STS to 4.2.1.3 (#20386) 2022-08-17 10:59:06 -07:00
Alan Ren
b66031bf16 vbump sts (#20375) 2022-08-16 16:38:39 -07:00
Raymond Truong
e001cb1da3 Vbump sqltoolsservice in mssql config (#20372) 2022-08-16 16:17:12 -07:00
Vasu Bhog
d70c9f2fa7 Add output channel for SQL Bindings extension (#20336) (#20350)
* add output channel for SQL Bindings extension

* add output channel to open once added
2022-08-16 12:18:40 -07:00
7 changed files with 30 additions and 10 deletions

View File

@@ -403,7 +403,7 @@ export class JobStepDialog extends AgentDialog<JobStepData> {
.withProps({
inputType: 'number',
width: '100%',
placeHolder: '0'
value: '0'
})
.component();
this.retryIntervalBox = view.modelBuilder.inputBox()
@@ -411,7 +411,7 @@ export class JobStepDialog extends AgentDialog<JobStepData> {
.withProps({
inputType: 'number',
width: '100%',
placeHolder: '0'
value: '0'
}).component();
let retryAttemptsContainer = view.modelBuilder.formContainer()

View File

@@ -1,6 +1,6 @@
{
"downloadUrl": "https://github.com/Microsoft/sqltoolsservice/releases/download/{#version#}/microsoft.sqltools.servicelayer-{#fileName#}",
"version": "4.2.0.16",
"version": "4.2.1.5",
"downloadFileNames": {
"Windows_86": "win-x86-net6.0.zip",
"Windows_64": "win-x64-net6.0.zip",

View File

@@ -151,8 +151,10 @@ export class BookTreeViewProvider implements vscode.TreeDataProvider<BookTreeIte
if (pinStatusChanged) {
// reset to original context value
bookTreeItem.contextValue = bookTreeItem.book.type === BookTreeItemType.Markdown ? BookTreeItemType.Markdown : getNotebookType(bookTreeItem.book);
// to search for notebook in allNotebooks dictionary we need to format uri
const notebookUri = vscode.Uri.file(bookTreeItem.book.contentPath).fsPath;
// if notebook is not in current book then it is a standalone notebook
let itemOpenedInBookTreeView = this.currentBook?.getNotebook(bookTreeItem.book.contentPath) ?? this.books.find(book => book.bookPath === bookTreeItem.book.contentPath)?.getNotebook(bookTreeItem.book.contentPath);
let itemOpenedInBookTreeView = this.currentBook?.getNotebook(notebookUri) ?? this.books.find(book => book.bookPath === bookTreeItem.book.contentPath)?.getNotebook(notebookUri);
if (itemOpenedInBookTreeView) {
itemOpenedInBookTreeView.contextValue = bookTreeItem.contextValue;
this._onDidChangeTreeData.fire(itemOpenedInBookTreeView.parent);

View File

@@ -25,6 +25,8 @@ export interface ILocalSettingsJson {
ConnectionStrings?: { [key: string]: string };
}
export const outputChannel = vscode.window.createOutputChannel(constants.serviceName);
/**
* copied and modified from vscode-azurefunctions extension
* https://github.com/microsoft/vscode-azurefunctions/blob/main/src/funcConfig/local.settings.ts
@@ -194,11 +196,15 @@ export async function getSettingsFile(projectFolder: string): Promise<string | u
}
/**
* Adds the required nuget package to the project
* @param selectedProjectFile is the users selected project file path
* Adds the latest SQL nuget package to the project
* @param projectFolder is the folder containing the project file
*/
export async function addSqlNugetReferenceToProjectFile(selectedProjectFile: string): Promise<void> {
await utils.executeCommand(`dotnet add "${selectedProjectFile}" package ${constants.sqlExtensionPackageName} --prerelease`);
export async function addSqlNugetReferenceToProjectFile(projectFolder: string): Promise<void> {
// clear the output channel prior to adding the nuget reference
outputChannel.clear();
let addNugetCommmand = await utils.executeCommand(`dotnet add "${projectFolder}" package ${constants.sqlExtensionPackageName} --prerelease`);
outputChannel.appendLine(constants.dotnetResult(addNugetCommmand));
outputChannel.show(true);
TelemetryReporter.sendActionEvent(TelemetryViews.CreateAzureFunctionWithSqlBinding, TelemetryActions.addSQLNugetPackage);
}
@@ -471,8 +477,6 @@ export async function promptAndUpdateConnectionStringSetting(projectUri: vscode.
connectionStringSettingName = selectedSetting?.label;
}
}
// Add sql extension package reference to project. If the reference is already there, it doesn't get added again
await addSqlNugetReferenceToProjectFile(projectUri.fsPath);
} else {
// if no AF project was found or there's more than one AF functions project in the workspace,
// ask for the user to input the setting name

View File

@@ -22,6 +22,7 @@ export const sqlBindingsHelpLink = 'https://github.com/Azure/azure-functions-sql
export const passwordPlaceholder = '******';
export const azureFunctionLocalSettingsFileName = 'local.settings.json';
export const vscodeOpenCommand = 'vscode.open';
export const serviceName = 'SQL Bindings';
// localized constants
export const functionNameTitle = localize('functionNameTitle', 'Function Name');
@@ -90,6 +91,7 @@ export function failedToParse(filename: string, error: any): string { return loc
export function addSqlBinding(functionName: string): string { return localize('addSqlBinding', 'Adding SQL Binding to function "{0}"...'), functionName; }
export function errorNewAzureFunction(error: any): string { return localize('errorNewAzureFunction', 'Error creating new Azure Function: {0}', utils.getErrorMessage(error)); }
export function manuallyEnterObjectName(userObjectName: string): string { return `$(pencil) ${userObjectName}`; }
export function dotnetResult(output: string): string { return localize('dotnetResult', 'Adding SQL nuget package:\n{0}', output); }
// Known Azure settings reference for Azure Functions
// https://docs.microsoft.com/en-us/azure/azure-functions/functions-app-settings

View File

@@ -7,6 +7,7 @@ import * as vscode from 'vscode';
import * as uuid from 'uuid';
import * as constants from '../common/constants';
import * as utils from '../common/utils';
import * as path from 'path';
import * as azureFunctionsUtils from '../common/azureFunctionsUtils';
import { TelemetryActions, TelemetryReporter, TelemetryViews } from '../common/telemetry';
import { addSqlBinding, getAzureFunctions } from '../services/azureFunctionsService';
@@ -113,6 +114,13 @@ export async function launchAddSqlBindingQuickpick(uri: vscode.Uri | undefined):
.withAdditionalProperties(propertyBag).send();
return;
}
// Add latest sql extension package reference to project
// only add if AF project (.csproj) is found
if (projectUri?.fsPath) {
await azureFunctionsUtils.addSqlNugetReferenceToProjectFile(path.dirname(projectUri.fsPath));
}
exitReason = 'done';
TelemetryReporter.createActionEvent(TelemetryViews.SqlBindingsQuickPick, TelemetryActions.finishAddSqlBinding)
.withAdditionalProperties(propertyBag).send();

View File

@@ -255,6 +255,10 @@ export async function createAzureFunction(node?: ITreeNodeInfo): Promise<void> {
suppressCreateProjectPrompt: true,
...(isCreateNewProject && { executeStep: connectionStringExecuteStep })
});
// Add latest sql extension package reference to project
await azureFunctionsUtils.addSqlNugetReferenceToProjectFile(projectFolder);
TelemetryReporter.createActionEvent(TelemetryViews.CreateAzureFunctionWithSqlBinding, telemetryStep)
.withAdditionalProperties(propertyBag)
.withConnectionInfo(connectionInfo).send();