Enables row-level interactions with a single sheet within a Google Sheets spreadsheet.

GoogleSheetsTable

Constructors

Methods

  • Counts the total number of rows in the table.

    Returns Promise<number>

    The row count.

  • Finds all of the rows in the table that are identified by a set of keys.

    Type Parameters

    • T extends string | number | symbol

      The type of the key

    Parameters

    • selector: KeyColumnSelector<T>

      A function that selects the key column within each row.

    • keys: T[]

      An array of keys to search for.

    Returns Promise<{ rowsByKey: Record<T, Row> }>

    A dictionary of keys to matching rows.

  • Finds all rows within the table.

    Returns Promise<{ rows: Row[] }>

    All of the rows.

  • Finds all rows within the table and sorts them.

    Parameters

    • sorting: ColumnSortSpec[]

      The columns to sort by.

    Returns Promise<{ rows: Row[] }>

    All of the rows, sorted.

  • Finds zero or more rows within the table.

    Parameters

    Returns Promise<{ rows: Row[] }>

    The found rows.

  • Finds zero or more rows within the table and sorts them.

    Parameters

    • predicate: SearchPredicate

      The search function.

    • sorting: ColumnSortSpec[]

      The columns to sort by.

    Returns Promise<{ rows: Row[] }>

    The found rows, sorted.

  • Inserts a new row into the table.

    Parameters

    • newRow: RowData

      An object containing the row data to insert.

    Returns Promise<{ insertedRow: Row }>

    The inserted row.

    Inserted row violates column constraints

  • Updates the data of an existing row in the table.

    Parameters

    • predicate: SearchPredicate

      The search function used to find the existing row to update.

    • rowUpdates: RowData

      An object containing the data to update.

    Returns Promise<{ updatedRow: Row }>

    The updated row.

    Row is not found

    Row change violates column constraints