mirror of
https://github.com/ckaczor/azuredatastudio.git
synced 2026-01-15 17:22:25 -05:00
Fixes for sql db projects dashboard (#15100)
* Fix ID assignment for sql db projects dashboard * Update with new fixes * Fix tests * Fix test
This commit is contained in:
@@ -7,6 +7,7 @@ import { DeploymentOptions } from '../../../mssql/src/mssql';
|
||||
|
||||
export interface IPublishSettings {
|
||||
databaseName: string;
|
||||
serverName: string;
|
||||
connectionUri: string;
|
||||
upgradeExisting: boolean;
|
||||
sqlCmdVariables?: Record<string, string>;
|
||||
@@ -16,6 +17,7 @@ export interface IPublishSettings {
|
||||
|
||||
export interface IGenerateScriptSettings {
|
||||
databaseName: string;
|
||||
serverName: string;
|
||||
connectionUri: string;
|
||||
sqlCmdVariables?: Record<string, string>;
|
||||
deploymentOptions?: DeploymentOptions;
|
||||
|
||||
@@ -19,6 +19,17 @@ export class DashboardData {
|
||||
}
|
||||
}
|
||||
|
||||
export class PublishData extends DashboardData {
|
||||
public targetServer: string;
|
||||
public targetDatabase: string;
|
||||
|
||||
constructor(projectFile: string, status: Status, target: string, startDate: string, targetDatabase: string, targetServer: string) {
|
||||
super(projectFile, status, target, startDate);
|
||||
this.targetDatabase = targetDatabase;
|
||||
this.targetServer = targetServer;
|
||||
}
|
||||
}
|
||||
|
||||
export enum Status {
|
||||
success,
|
||||
failed,
|
||||
|
||||
@@ -16,6 +16,7 @@ import { SqlConnectionDataSource } from '../dataSources/sqlConnectionStringSourc
|
||||
// only reading db name, connection string, and SQLCMD vars from profile for now
|
||||
export interface PublishProfile {
|
||||
databaseName: string;
|
||||
serverName: string;
|
||||
connectionId: string;
|
||||
connection: string;
|
||||
sqlCmdVariables: Record<string, string>;
|
||||
@@ -45,6 +46,7 @@ export async function load(profileUri: Uri, dacfxService: mssql.IDacFxService):
|
||||
|
||||
return {
|
||||
databaseName: targetDbName,
|
||||
serverName: connectionInfo.server,
|
||||
connectionId: connectionInfo.connectionId,
|
||||
connection: connectionInfo.connection,
|
||||
sqlCmdVariables: sqlCmdVariables,
|
||||
@@ -52,14 +54,14 @@ export async function load(profileUri: Uri, dacfxService: mssql.IDacFxService):
|
||||
};
|
||||
}
|
||||
|
||||
async function readConnectionString(xmlDoc: any): Promise<{ connectionId: string, connection: string }> {
|
||||
async function readConnectionString(xmlDoc: any): Promise<{ connectionId: string, connection: string, server: string }> {
|
||||
let targetConnection: string = '';
|
||||
let connId: string = '';
|
||||
let server: string = '';
|
||||
|
||||
if (xmlDoc.documentElement.getElementsByTagName(constants.targetConnectionString).length > 0) {
|
||||
const targetConnectionString = xmlDoc.documentElement.getElementsByTagName(constants.TargetConnectionString)[0].textContent;
|
||||
const dataSource = new SqlConnectionDataSource('', targetConnectionString);
|
||||
let server: string = '';
|
||||
let username: string = '';
|
||||
const connectionProfile = dataSource.getConnectionProfile();
|
||||
|
||||
@@ -86,6 +88,7 @@ async function readConnectionString(xmlDoc: any): Promise<{ connectionId: string
|
||||
|
||||
return {
|
||||
connectionId: connId,
|
||||
connection: targetConnection
|
||||
connection: targetConnection,
|
||||
server: server
|
||||
};
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user