mirror of
https://github.com/ckaczor/azuredatastudio.git
synced 2026-01-17 17:22:42 -05:00
Adding None bindings to the sqlProjects service (#22085)
* Adding None bindings * updating names of None bindings
This commit is contained in:
@@ -367,6 +367,56 @@ export class SqlProjectsService implements mssql.ISqlProjectsService {
|
||||
return await this.runWithErrorHandling(contracts.GetSqlObjectScriptsRequest.type, params);
|
||||
}
|
||||
|
||||
/**
|
||||
* Add a SQL object script to a project
|
||||
* @param projectUri Absolute path of the project, including .sqlproj
|
||||
* @param path Path of the script, including .sql, relative to the .sqlproj
|
||||
*/
|
||||
public async addNoneItem(projectUri: string, path: string): Promise<azdata.ResultStatus> {
|
||||
const params: contracts.SqlProjectScriptParams = { projectUri: projectUri, path: path };
|
||||
return await this.runWithErrorHandling(contracts.AddNoneItemRequest.type, params);
|
||||
}
|
||||
|
||||
/**
|
||||
* Delete a SQL object script from a project
|
||||
* @param projectUri Absolute path of the project, including .sqlproj
|
||||
* @param path Path of the script, including .sql, relative to the .sqlproj
|
||||
*/
|
||||
public async deleteNoneItem(projectUri: string, path: string): Promise<azdata.ResultStatus> {
|
||||
const params: contracts.SqlProjectScriptParams = { projectUri: projectUri, path: path };
|
||||
return await this.runWithErrorHandling(contracts.DeleteNoneItemRequest.type, params);
|
||||
}
|
||||
|
||||
/**
|
||||
* Exclude a SQL object script from a project
|
||||
* @param projectUri Absolute path of the project, including .sqlproj
|
||||
* @param path Path of the script, including .sql, relative to the .sqlproj
|
||||
*/
|
||||
public async excludeNoneItem(projectUri: string, path: string): Promise<azdata.ResultStatus> {
|
||||
const params: contracts.SqlProjectScriptParams = { projectUri: projectUri, path: path };
|
||||
return await this.runWithErrorHandling(contracts.ExcludeNoneItemRequest.type, params);
|
||||
}
|
||||
|
||||
/**
|
||||
* getNoneScripts
|
||||
* @param projectUri Absolute path of the project, including .sqlproj
|
||||
*/
|
||||
public async getNoneItems(projectUri: string): Promise<mssql.GetScriptsResult> {
|
||||
const params: contracts.SqlProjectParams = { projectUri: projectUri };
|
||||
return await this.runWithErrorHandling(contracts.GetNoneItemsRequest.type, params);
|
||||
}
|
||||
|
||||
/**
|
||||
* Move a SQL object script in a project
|
||||
* @param projectUri Absolute path of the project, including .sqlproj
|
||||
* @param destinationPath Destination path of the file or folder, relative to the .sqlproj
|
||||
* @param path Path of the script, including .sql, relative to the .sqlproj
|
||||
*/
|
||||
public async moveNoneItem(projectUri: string, destinationPath: string, path: string): Promise<azdata.ResultStatus> {
|
||||
const params: contracts.MoveItemParams = { projectUri: projectUri, destinationPath: destinationPath, path: path };
|
||||
return await this.runWithErrorHandling(contracts.MoveNoneItemRequest.type, params);
|
||||
}
|
||||
|
||||
private async runWithErrorHandling<P, R, E, RO>(type: RequestType<P, R, E, RO>, params: P): Promise<R> {
|
||||
try {
|
||||
const result = await this.client.sendRequest(type, params);
|
||||
|
||||
Reference in New Issue
Block a user