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

Export

GoogleSheetsTable

Constructors

Methods

  • Counts the total number of rows in the table.

    Returns Promise<number>

    The row count.

    Async

  • Deletes an existing row in the table.

    Parameters

    • predicate: SearchPredicate

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

    Returns Promise<void>

    Async

    Throws

    Row is not found

  • 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.

    Async

  • Finds all rows within the table.

    Returns Promise<{
        rows: Row[];
    }>

    All of the rows.

    Async

  • 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.

    Async

  • Finds zero or more rows within the table.

    Parameters

    Returns Promise<{
        rows: Row[];
    }>

    The found rows.

    Async

  • 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.

    Async

  • 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.

    Async

    Throws

    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.

    Async

    Throws

    Row is not found

    Throws

    Row change violates column constraints

Generated using TypeDoc