nshiab / simple-data-analysis

Easy-to-use and high-performance JavaScript library for data analysis. Works with tabular and geospatial data.
https://nshiab.github.io/simple-data-analysis/
MIT License
251 stars 15 forks source link

typo in documentation #753

Closed graemebruce closed 2 weeks ago

graemebruce commented 1 month ago

insertTables() docs has "insertTable" in examples.

nshiab commented 1 month ago

Which version are you using?

This is what I see on the latest:

 /**
   * Inserts all rows from another table (or multiple tables) into this table.
   *
   * @example
   * Basic usage with one table
   * ```ts
   * // Insert all rows from tableB into this table.
   * await tableA.insertTables("tableB")
   * ```
   *
   * @example
   * With multiple tables
   * ```ts
   * // Insert all rows from tableB and tableC into this table.
   * await tableA.insertTables([ "tableB", "tableC" ])
   * ```
   *
   * @param tablesToInsert - The name of the table(s) from which rows will be inserted.
   *
   * @category Importing data
   */
  async insertTables(tablesToInsert: SimpleWebTable | SimpleWebTable[]) {
    const array = Array.isArray(tablesToInsert)
      ? tablesToInsert
      : [tablesToInsert];
    await queryDB(
      this,
      array
        .map(
          (tableToInsert) =>
            `INSERT INTO ${this.name} BY NAME SELECT * FROM ${tableToInsert.name};`,
        )
        .join("\n"),
      mergeOptions(this, {
        table: this.name,
        method: "insertTables()",
        parameters: { tablesToInsert },
      }),
    );
  }
nshiab commented 2 weeks ago

Closing because I think it's related to a previous version.