mirror of
https://github.com/ckaczor/azuredatastudio.git
synced 2026-02-16 18:46:40 -05:00
Adding sqlproj property bindings (#22106)
This commit is contained in:
@@ -616,6 +616,14 @@ export namespace UpdateProjectForCrossPlatformRequest {
|
|||||||
export const type = new RequestType<SqlProjectParams, azdata.ResultStatus, void, void>('sqlProjects/updateProjectForCrossPlatform');
|
export const type = new RequestType<SqlProjectParams, azdata.ResultStatus, void, void>('sqlProjects/updateProjectForCrossPlatform');
|
||||||
}
|
}
|
||||||
|
|
||||||
|
export namespace GetProjectPropertiesRequest {
|
||||||
|
export const type = new RequestType<SqlProjectParams, mssql.GetProjectPropertiesResult, void, void>('sqlProjects/getProjectProperties');
|
||||||
|
}
|
||||||
|
|
||||||
|
export namespace SetDatabaseSourceRequest {
|
||||||
|
export const type = new RequestType<SetDatabaseSourceParams, azdata.ResultStatus, void, void>('sqlProjects/setDatabaseSource');
|
||||||
|
}
|
||||||
|
|
||||||
//#endregion
|
//#endregion
|
||||||
|
|
||||||
//#region File/folder functions
|
//#region File/folder functions
|
||||||
@@ -794,6 +802,13 @@ export interface SqlProjectScriptParams extends SqlProjectParams {
|
|||||||
path: string;
|
path: string;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
export interface SetDatabaseSourceParams extends SqlProjectParams {
|
||||||
|
/**
|
||||||
|
* Source of the database schema, used in telemetry
|
||||||
|
*/
|
||||||
|
databaseSource: string;
|
||||||
|
}
|
||||||
|
|
||||||
export interface AddDacpacReferenceParams extends AddUserDatabaseReferenceParams {
|
export interface AddDacpacReferenceParams extends AddUserDatabaseReferenceParams {
|
||||||
/**
|
/**
|
||||||
* Path to the .dacpac file
|
* Path to the .dacpac file
|
||||||
|
|||||||
41
extensions/mssql/src/mssql.d.ts
vendored
41
extensions/mssql/src/mssql.d.ts
vendored
@@ -465,6 +465,19 @@ declare module 'mssql' {
|
|||||||
*/
|
*/
|
||||||
updateProjectForCrossPlatform(projectUri: string): Promise<azdata.ResultStatus>;
|
updateProjectForCrossPlatform(projectUri: string): Promise<azdata.ResultStatus>;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Set the DatabaseSource property of a .sqlproj file
|
||||||
|
* @param projectUri Absolute path of the project, including .sqlproj
|
||||||
|
* @param databaseSource Source of the database schema, used in telemetry
|
||||||
|
*/
|
||||||
|
setDatabaseSource(projectUri: string, databaseSource: string): Promise<azdata.ResultStatus>;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Get the cross-platform compatibility status for a project
|
||||||
|
* @param projectUri Absolute path of the project, including .sqlproj
|
||||||
|
*/
|
||||||
|
getProjectProperties(projectUri: string): Promise<GetProjectPropertiesResult>;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Add a SQLCMD variable to a project
|
* Add a SQLCMD variable to a project
|
||||||
* @param projectUri Absolute path of the project, including .sqlproj
|
* @param projectUri Absolute path of the project, including .sqlproj
|
||||||
@@ -637,6 +650,34 @@ declare module 'mssql' {
|
|||||||
scripts: string[];
|
scripts: string[];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
export interface GetProjectPropertiesResult extends azdata.ResultStatus {
|
||||||
|
/**
|
||||||
|
* GUID for the SQL project
|
||||||
|
*/
|
||||||
|
projectGuid: string;
|
||||||
|
/**
|
||||||
|
* Build configuration, defaulted to Debug if not specified
|
||||||
|
*/
|
||||||
|
configuration: string;
|
||||||
|
/**
|
||||||
|
* Build platform, defaulted to AnyCPU if not specified
|
||||||
|
*/
|
||||||
|
platform: string;
|
||||||
|
/**
|
||||||
|
* Output path for build, defaulted to "bin/Debug" if not specified.
|
||||||
|
May be absolute or relative.
|
||||||
|
*/
|
||||||
|
outputPath: string;
|
||||||
|
/**
|
||||||
|
* Default collation for the project, defaulted to SQL_Latin1_General_CP1_CI_AS if not specified
|
||||||
|
*/
|
||||||
|
defaultCollation: string;
|
||||||
|
/**
|
||||||
|
* Source of the database schema, used in telemetry
|
||||||
|
*/
|
||||||
|
databaseSource?: string;
|
||||||
|
}
|
||||||
|
|
||||||
//#endregion
|
//#endregion
|
||||||
|
|
||||||
//#region Types
|
//#region Types
|
||||||
|
|||||||
@@ -238,6 +238,25 @@ export class SqlProjectsService implements mssql.ISqlProjectsService {
|
|||||||
return await this.runWithErrorHandling(contracts.UpdateProjectForCrossPlatformRequest.type, params);
|
return await this.runWithErrorHandling(contracts.UpdateProjectForCrossPlatformRequest.type, params);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Get the cross-platform compatibility status for a project
|
||||||
|
* @param projectUri Absolute path of the project, including .sqlproj
|
||||||
|
*/
|
||||||
|
public async getProjectProperties(projectUri: string): Promise<mssql.GetProjectPropertiesResult> {
|
||||||
|
const params: contracts.SqlProjectParams = { projectUri: projectUri };
|
||||||
|
return await this.runWithErrorHandling(contracts.GetProjectPropertiesRequest.type, params);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Set the DatabaseSource property of a .sqlproj file
|
||||||
|
* @param projectUri Absolute path of the project, including .sqlproj
|
||||||
|
* @param databaseSource Source of the database schema, used in telemetry
|
||||||
|
*/
|
||||||
|
public async setDatabaseSource(projectUri: string, databaseSource: string): Promise<azdata.ResultStatus> {
|
||||||
|
const params: contracts.SetDatabaseSourceParams = { projectUri: projectUri, databaseSource: databaseSource };
|
||||||
|
return await this.runWithErrorHandling(contracts.SetDatabaseSourceRequest.type, params);
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Add a SQLCMD variable to a project
|
* Add a SQLCMD variable to a project
|
||||||
* @param projectUri Absolute path of the project, including .sqlproj
|
* @param projectUri Absolute path of the project, including .sqlproj
|
||||||
|
|||||||
41
extensions/types/vscode-mssql.d.ts
vendored
41
extensions/types/vscode-mssql.d.ts
vendored
@@ -585,6 +585,19 @@ declare module 'vscode-mssql' {
|
|||||||
*/
|
*/
|
||||||
updateProjectForCrossPlatform(projectUri: string): Promise<ResultStatus>;
|
updateProjectForCrossPlatform(projectUri: string): Promise<ResultStatus>;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Set the DatabaseSource property of a .sqlproj file
|
||||||
|
* @param projectUri Absolute path of the project, including .sqlproj
|
||||||
|
* @param databaseSource Source of the database schema, used in telemetry
|
||||||
|
*/
|
||||||
|
setDatabaseSource(projectUri: string, databaseSource: string): Promise<ResultStatus>;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Get the cross-platform compatibility status for a project
|
||||||
|
* @param projectUri Absolute path of the project, including .sqlproj
|
||||||
|
*/
|
||||||
|
getProjectProperties(projectUri: string): Promise<GetProjectPropertiesResult>;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Add a SQLCMD variable to a project
|
* Add a SQLCMD variable to a project
|
||||||
* @param projectUri Absolute path of the project, including .sqlproj
|
* @param projectUri Absolute path of the project, including .sqlproj
|
||||||
@@ -718,6 +731,34 @@ declare module 'vscode-mssql' {
|
|||||||
isCrossPlatformCompatible: boolean;
|
isCrossPlatformCompatible: boolean;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
export interface GetProjectPropertiesResult extends ResultStatus {
|
||||||
|
/**
|
||||||
|
* GUID for the SQL project
|
||||||
|
*/
|
||||||
|
projectGuid: string;
|
||||||
|
/**
|
||||||
|
* Build configuration, defaulted to Debug if not specified
|
||||||
|
*/
|
||||||
|
configuration: string;
|
||||||
|
/**
|
||||||
|
* Build platform, defaulted to AnyCPU if not specified
|
||||||
|
*/
|
||||||
|
platform: string;
|
||||||
|
/**
|
||||||
|
* Output path for build, defaulted to "bin/Debug" if not specified.
|
||||||
|
May be absolute or relative.
|
||||||
|
*/
|
||||||
|
outputPath: string;
|
||||||
|
/**
|
||||||
|
* Default collation for the project, defaulted to SQL_Latin1_General_CP1_CI_AS if not specified
|
||||||
|
*/
|
||||||
|
defaultCollation: string;
|
||||||
|
/**
|
||||||
|
* Source of the database schema, used in telemetry
|
||||||
|
*/
|
||||||
|
databaseSource?: string;
|
||||||
|
}
|
||||||
|
|
||||||
export interface GetDatabaseReferencesResult extends ResultStatus {
|
export interface GetDatabaseReferencesResult extends ResultStatus {
|
||||||
/**
|
/**
|
||||||
* Array of system database references contained in the project
|
* Array of system database references contained in the project
|
||||||
|
|||||||
Reference in New Issue
Block a user