Add AddNugetPackageReferenceRequest for sql projects (#22757)

* Add AddnugetPackageReferenceRequest for sql projects

* update comment

* fix whitespace
This commit is contained in:
Kim Santiago
2023-04-17 13:31:17 -07:00
committed by GitHub
parent 02e61d1598
commit 938a8bffbe
3 changed files with 53 additions and 0 deletions

View File

@@ -77,6 +77,21 @@ export class SqlProjectsService extends BaseService implements mssql.ISqlProject
return await this.runWithErrorHandling(contracts.AddSystemDatabaseReferenceRequest.type, params);
}
/**
* Add a nuget package database reference to a project
* @param projectUri Absolute path of the project, including .sqlproj
* @param packageName Name of the referenced nuget package
* @param packageVersion Version of the referenced nuget package
* @param suppressMissingDependencies Whether to suppress missing dependencies
* @param databaseVariable SQLCMD variable name for specifying the other database this reference is to, if different from that of the current project
* @param serverVariable SQLCMD variable name for specifying the other server this reference is to, if different from that of the current project. If this is set, DatabaseVariable must also be set.
* @param databaseLiteral Literal name used to reference another database in the same server, if not using SQLCMD variables
*/
public async addNugetPackageReference(projectUri: string, packageName: string, packageVersion: string, suppressMissingDependencies: boolean, databaseVariable?: string, serverVariable?: string, databaseLiteral?: string): Promise<azdata.ResultStatus> {
const params: contracts.AddNugetPackageReferenceParams = { projectUri: projectUri, packageName: packageName, packageVersion: packageVersion, suppressMissingDependencies: suppressMissingDependencies, databaseVariable: databaseVariable, serverVariable: serverVariable, databaseLiteral: databaseLiteral };
return await this.runWithErrorHandling(contracts.AddNugetPackageReferenceRequest.type, params);
}
/**
* Delete a database reference from a project
* @param projectUri Absolute path of the project, including .sqlproj