mirror of
https://github.com/ckaczor/azuredatastudio.git
synced 2026-01-19 09:35:36 -05:00
remove Last Backup colum on assessment db list. (#20728)
* remove Last Backup colum on assessment db list. * column cleanup
This commit is contained in:
@@ -14,7 +14,8 @@ import { v4 as uuidv4 } from 'uuid';
|
||||
import { sendSqlMigrationActionEvent, TelemetryAction, TelemetryViews, logError } from '../telemtery';
|
||||
import { hashString, deepClone } from '../api/utils';
|
||||
import { SKURecommendationPage } from '../wizard/skuRecommendationPage';
|
||||
import { excludeDatabses, TargetDatabaseInfo } from '../api/sqlUtils';
|
||||
import { excludeDatabses, getSqlString, TargetDatabaseInfo } from '../api/sqlUtils';
|
||||
import * as queries from '../constants/queries';
|
||||
const localize = nls.loadMessageBundle();
|
||||
|
||||
export enum State {
|
||||
@@ -1189,6 +1190,37 @@ export class MigrationStateModel implements Model, vscode.Disposable {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
//Get QueryProvider
|
||||
private async runQueryWithResults(queryString: string): Promise<azdata.SimpleExecuteResult> {
|
||||
const connectionProfile = await this.getSourceConnectionProfile();
|
||||
const connectionUri = await azdata.connection.getUriForConnection(this._sourceConnectionId);
|
||||
const queryProvider = azdata.dataprotocol.getProvider<azdata.QueryProvider>(connectionProfile.providerId, azdata.DataProviderType.QueryProvider);
|
||||
|
||||
return await queryProvider.runQueryAndReturn(connectionUri, queryString);
|
||||
}
|
||||
|
||||
public async getDatabasesList(): Promise<azdata.DatabaseInfo[]> {
|
||||
try {
|
||||
const queryResult = await this.runQueryWithResults(queries.SELECT_ALL_DB_W_SIZE);
|
||||
|
||||
const result = queryResult.rows.map(row => {
|
||||
return {
|
||||
options: {
|
||||
name: getSqlString(row[0]),
|
||||
state: getSqlString(row[1]),
|
||||
sizeInMB: getSqlString(row[2]),
|
||||
}
|
||||
};
|
||||
}) ?? [];
|
||||
|
||||
return result;
|
||||
} catch (error) {
|
||||
logError(TelemetryViews.SkuRecommendationWizard, TelemetryAction.GetDatabasesListFailed, error);
|
||||
|
||||
return [];
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
export interface ServerAssessment {
|
||||
|
||||
Reference in New Issue
Block a user