Repository: sequelize/sequelize
File: packages/core/src/dialects/abstract/query-interface-typescript.ts (TypeScript)

Code before:

    // Drop all the tables loop to avoid deadlocks and timeouts
    for (const tableName of tableNames) {
      // eslint-disable-next-line no-await-in-loop
      await this.dropTable(tableName, dropOptions);
    }
  }

  /**
   * List tables
   *
   * @param options
   */
  async listTables(options?: QiListTablesOptions): Promise<TableNameWithSchema[]> {
    const sql = this.queryGenerator.listTablesQuery(options);

    return this.sequelize.queryRaw<TableNameWithSchema>(sql, { ...options, raw: true, type: QueryTypes.SELECT });
  }

  /**
   * Show all tables
   *
   * @deprecated Use {@link listTables} instead.
   * @param options
   */
  async showAllTables(options?: QueryRawOptions): Promise<TableNameWithSchema[]> {
    showAllToListTables();

    return this.listTables(options);
  }

  /**
   * Returns a promise that will resolve to true if the table or model exists in the database, false otherwise.
   *
   * @param tableName - The name of the table or model
   * @param options - Query options
   */
  async tableExists(tableName: TableNameOrModel, options?: QueryRawOptions): Promise<boolean> {
    const sql = this.queryGenerator.tableExistsQuery(tableName);
    const out = await this.sequelize.query(sql, { ...options, type: QueryTypes.SELECT });

    return out.length === 1;
  }

  /**
   * Describe a table structure
   *
   * This method returns an array of hashes containing information about all attributes in the table.
   *
   * ```js
   * {

Review comment (suggestion):
```suggestion
  async showAllTables(options?: QiListTablesOptions): Promise<TableNameWithSchema[]> {
```

Code after:

    // Drop all the tables loop to avoid deadlocks and timeouts
    for (const tableName of tableNames) {
      // eslint-disable-next-line no-await-in-loop
      await this.dropTable(tableName, dropOptions);
    }
  }

  /**
   * List tables
   *
   * @param options
   */
  async listTables(options?: QiListTablesOptions): Promise<TableNameWithSchema[]> {
    const sql = this.queryGenerator.listTablesQuery(options);

    return this.sequelize.queryRaw<TableNameWithSchema>(sql, { ...options, raw: true, type: QueryTypes.SELECT });
  }

  /**
   * Show all tables
   *
   * @deprecated Use {@link listTables} instead.
   * @param options
   */
  async showAllTables(options?: QiListTablesOptions): Promise<TableNameWithSchema[]> {
    showAllToListTables();

    return this.listTables(options);
  }

  /**
   * Returns a promise that will resolve to true if the table or model exists in the database, false otherwise.
   *
   * @param tableName - The name of the table or model
   * @param options - Query options
   */
  async tableExists(tableName: TableNameOrModel, options?: QueryRawOptions): Promise<boolean> {
    const sql = this.queryGenerator.tableExistsQuery(tableName);
    const out = await this.sequelize.query(sql, { ...options, type: QueryTypes.SELECT });

    return out.length === 1;
  }

  /**
   * Describe a table structure
   *
   * This method returns an array of hashes containing information about all attributes in the table.
   *
   * ```js
   * {