"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.ConcurrentQuery = void 0;
/*---------------------------------------------------------------------------------------------
* Copyright (c) Bentley Systems, Incorporated. All rights reserved.
* See LICENSE.md in the project root for license terms and full copyright notice.
*--------------------------------------------------------------------------------------------*/
const core_common_1 = require("@itwin/core-common");
/** @internal */
class ConcurrentQuery {
    /** @internal */
    static async executeQueryRequest(conn, request) {
        return new Promise((resolve) => {
            request.kind = core_common_1.DbRequestKind.ECSql;
            conn.concurrentQueryExecute(request, (response) => {
                resolve(response);
            });
        });
    }
    /** @internal */
    static async executeBlobRequest(conn, request) {
        return new Promise((resolve) => {
            request.kind = core_common_1.DbRequestKind.BlobIO;
            conn.concurrentQueryExecute(request, (response) => {
                resolve(response);
            });
        });
    }
    static resetConfig(conn, config) {
        return conn.concurrentQueryResetConfig(config);
    }
    static shutdown(conn) {
        conn.concurrentQueryShutdown();
    }
}
exports.ConcurrentQuery = ConcurrentQuery;
//# sourceMappingURL=ConcurrentQuery.js.map