in packages/quick_start/src/Utils.ts [177:192]
public static async executeCommand(kustoClient: KustoClient, databaseName: string, command: string, scope: string, exit: boolean = true) {
try {
const clientRequestProperties = this.createClientRequestProperties(scope);
const responseDataSet = await kustoClient.execute(databaseName, command, clientRequestProperties);
// Tip: Actual implementations wouldn't generally print the response from a control command.We print here to demonstrate what a sample of the
// response looks like.
Console.log(`Response from executed control command '${command}':\n--------------------`);
for (const row of responseDataSet.primaryResults[0].rows()) {
Console.log(row.toJSON());
}
} catch (ex: any) {
if (exit) {
this.errorHandler(`Failed to execute command: '${command}'`, ex);
}
}
}