mirror of
https://github.com/ckaczor/azuredatastudio.git
synced 2026-02-16 18:46:40 -05:00
Add profile section in Publish project UI (#21906)
* Add profile section in Publish project UI * Move publish profile row below Publish Target * Add contract for savePublishProfie and SaveProfileAs button functionality * Make the DacFx contract functional * Send values from UI to DacFx service call * Fix build error * Address comment, remove print statements * Address comments * Set correct connection string
This commit is contained in:
@@ -551,6 +551,14 @@ export interface ParseTSqlScriptParams {
|
||||
databaseSchemaProvider: string;
|
||||
}
|
||||
|
||||
export interface SavePublishProfileParams {
|
||||
profilePath: string;
|
||||
databaseName: string;
|
||||
connectionString: string;
|
||||
sqlCommandVariableValues?: Record<string, string>;
|
||||
deploymentOptions?: mssql.DeploymentOptions;
|
||||
}
|
||||
|
||||
export namespace ExportRequest {
|
||||
export const type = new RequestType<ExportParams, mssql.DacFxResult, void, void>('dacfx/export');
|
||||
}
|
||||
@@ -587,6 +595,10 @@ export namespace ParseTSqlScriptRequest {
|
||||
export const type = new RequestType<ParseTSqlScriptParams, mssql.ParseTSqlScriptResult, void, void>('dacfx/parseTSqlScript');
|
||||
}
|
||||
|
||||
export namespace SavePublishProfileRequest {
|
||||
export const type = new RequestType<SavePublishProfileParams, azdata.ResultStatus, void, void>('dacfx/savePublishProfile');
|
||||
}
|
||||
|
||||
// ------------------------------- </ DacFx > ------------------------------------
|
||||
|
||||
// ------------------------------- <CMS> ----------------------------------------
|
||||
|
||||
@@ -141,4 +141,15 @@ export class DacFxService implements mssql.IDacFxService {
|
||||
throw e;
|
||||
}
|
||||
}
|
||||
|
||||
public async savePublishProfile(profilePath: string, databaseName: string, connectionString: string, sqlCommandVariableValues?: Record<string, string>, deploymentOptions?: mssql.DeploymentOptions): Promise<azdata.ResultStatus> {
|
||||
const params: contracts.SavePublishProfileParams = { profilePath, databaseName, connectionString, sqlCommandVariableValues, deploymentOptions };
|
||||
try {
|
||||
const result = await this.client.sendRequest(contracts.SavePublishProfileRequest.type, params);
|
||||
return result;
|
||||
} catch (e) {
|
||||
this.client.logFailedRequest(contracts.SavePublishProfileRequest.type, e);
|
||||
throw e;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
1
extensions/mssql/src/mssql.d.ts
vendored
1
extensions/mssql/src/mssql.d.ts
vendored
@@ -244,6 +244,7 @@ declare module 'mssql' {
|
||||
getOptionsFromProfile(profilePath: string): Thenable<DacFxOptionsResult>;
|
||||
validateStreamingJob(packageFilePath: string, createStreamingJobTsql: string): Thenable<ValidateStreamingJobResult>;
|
||||
parseTSqlScript(filePath: string, databaseSchemaProvider: string): Thenable<ParseTSqlScriptResult>;
|
||||
savePublishProfile(profilePath: string, databaseName: string, connectionString: string, sqlCommandVariableValues?: Record<string, string>, deploymentOptions?: DeploymentOptions): Thenable<azdata.ResultStatus>;
|
||||
}
|
||||
|
||||
export interface DacFxResult extends azdata.ResultStatus {
|
||||
|
||||
Reference in New Issue
Block a user