mirror of
https://github.com/ckaczor/azuredatastudio.git
synced 2026-02-16 10:58:30 -05:00
Added data points for Table Designer (#18182)
* added server infor and metrics for table designer * update generate script * pr comments * format more files * pr comments * make changes to core * remove unused imports * add server info * revert enum change and add publish event * format doc * nitpicks * remove os version * remove modifier from telemetry info * remove error message
This commit is contained in:
@@ -8,17 +8,21 @@ import * as azdata from 'azdata';
|
||||
import * as vscode from 'vscode';
|
||||
import { sqlProviderName } from '../constants';
|
||||
import { generateUuid } from 'vscode-languageclient/lib/utils/uuid';
|
||||
import { ITelemetryEventProperties, Telemetry } from '../telemetry';
|
||||
|
||||
export function registerTableDesignerCommands(appContext: AppContext) {
|
||||
appContext.extensionContext.subscriptions.push(vscode.commands.registerCommand('mssql.newTable', async (context: azdata.ObjectExplorerContext) => {
|
||||
const connectionString = await azdata.connection.getConnectionString(context.connectionProfile.id, true);
|
||||
const serverInfo = await azdata.connection.getServerInfo(context.connectionProfile.id);
|
||||
let telemetryInfo: ITelemetryEventProperties = {};
|
||||
telemetryInfo = Telemetry.fillServerInfo(telemetryInfo, serverInfo);
|
||||
await azdata.designers.openTableDesigner(sqlProviderName, {
|
||||
server: context.connectionProfile.serverName,
|
||||
database: context.connectionProfile.databaseName,
|
||||
isNewTable: true,
|
||||
id: generateUuid(),
|
||||
connectionString: connectionString
|
||||
});
|
||||
}, telemetryInfo);
|
||||
}));
|
||||
|
||||
appContext.extensionContext.subscriptions.push(vscode.commands.registerCommand('mssql.designTable', async (context: azdata.ObjectExplorerContext) => {
|
||||
@@ -28,6 +32,9 @@ export function registerTableDesignerCommands(appContext: AppContext) {
|
||||
const name = context.nodeInfo.metadata.name;
|
||||
const connectionString = await azdata.connection.getConnectionString(context.connectionProfile.id, true);
|
||||
const connectionUri = await azdata.connection.getUriForConnection(context.connectionProfile.id);
|
||||
const serverInfo = await azdata.connection.getServerInfo(context.connectionProfile.id);
|
||||
let telemetryInfo: ITelemetryEventProperties = {};
|
||||
telemetryInfo = Telemetry.fillServerInfo(telemetryInfo, serverInfo);
|
||||
await azdata.designers.openTableDesigner(sqlProviderName, {
|
||||
server: server,
|
||||
database: database,
|
||||
@@ -36,6 +43,6 @@ export function registerTableDesignerCommands(appContext: AppContext) {
|
||||
schema: schema,
|
||||
id: `${connectionUri}|${database}|${schema}|${name}`,
|
||||
connectionString: connectionString
|
||||
});
|
||||
}, telemetryInfo);
|
||||
}));
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user