Skip to content

Data Operations

HolySheets! provides a set of CRUD-like operations to interact with your Google Sheets data:

  • Finding Data

    • findFirst: Retrieves the first matching record.
    • findMany: Retrieves multiple matching records.
    • findAll: Retrieves all records.
  • Inserting Data

  • Updating Data

  • Deleting Data

  • Clearing Data

    • clearFirst: Clears the first matching record’s cell contents (row not removed).
    • clearMany: Clears all matching records’ cell contents (rows not removed).

All operations can optionally return metadata such as affected ranges and operation duration. To include metadata in your responses, pass { includeMetadata: true } in the second parameter of any operation method.

typescript
// Example: Finding the first record named "Alice" and including metadata
const result = await holySheetsInstance.findFirst(
  {
    where: { name: 'Alice' }
  },
  {
    includeMetadata: true
  }
)

console.log(result.data) // The matching record
console.log(result.metadata) // Optional metadata (if requested)

Released under the MIT License.