private async assureTableExists()

in src/QLDBKVS.ts [127:142]


    private async assureTableExists(tableName: string): Promise<boolean> {
        const fcnName = "[QLDBKVS.assureTableExists]";
        // In case our table has not been created yet, waiting for it to be created
        let cycles = TABLE_CREATION_MAX_WAIT / 100;
        logger.debug(`${fcnName} Table with name ${tableName} still does not exist, waiting for it to be created.`)
        do {
            await sleep(100);
            cycles--;
            if (this.tableState === "EXIST") {
                return true
            }
            if (cycles === 0) {
                throw new Error(`Could not create a table with name ${tableName} in ${TABLE_CREATION_MAX_WAIT} milliseconds`)
            }
        } while (this.tableState === "CREATING" || this.tableState === "CHECKING");
    }