private static async createIngestionMappings()

in packages/quick_start/src/SampleApp.ts [304:322]


    private static async createIngestionMappings(
        useExistingMapping: boolean,
        kustoClient: KustoClient,
        databaseName: string,
        tableName: string,
        mappingName: string,
        mappingValue: string,
        dataFormat: DataFormat,
    ): Promise<void> {
        if (useExistingMapping || !mappingValue) {
            return;
        }
        const ingestionMappingKind = dataFormatMappingKind(dataFormat);
        await this.waitForUserToProceed(`Create a '${ingestionMappingKind}' mapping reference named '${mappingName}'`);
        mappingName = mappingName ? mappingName : "DefaultQuickstartMapping" + uuidv4().substring(0, 4);

        const command = `.create-or-alter table ${tableName} ingestion ${ingestionMappingKind.toLowerCase()} mapping '${mappingName}' '${mappingValue}'`;
        await Queries.executeCommand(kustoClient, databaseName, command, "Node_SampleApp_ControlCommand");
    }