メインコンテンツにスキップ

gassma

GASsma is Google Apps Script(GAS) of SpreadSheet library that can be used like prisma.

AI Summary

GASsma

Use Sheets as a DB in GAS via Prisma-like syntax

Target Users

Any-level GAS developers building internal tools needing simple persistence without a DB

Problems Solved

Need simple persistence in GAS without a DB; use Sheets as a database

Tags

Main Features

1
Prisma-like API

Operate Sheets with Prisma-like syntax as stated in the README

2
Use Sheets as DB

Treat Sheets like a database: CRUD, filtering, sorting, aggregation are supported per README

3
Easy setup

Start via npm install or by adding the provided Script ID

4
TypeScript ready

Use familiar TypeScript/JavaScript methods to work with data

5
No-DB persistence

Suited for simple persistence without a traditional database setup

Usage Examples

Fetch data from Spreadsheet (with Clasp)

The following is based on the README example.

// Import the library
import { Gassma } from "gassma";

// Create a client
const gassma = new Gassma.GassmaClient();

// Fetch data from the Spreadsheet (findMany)
function myFunction(){
  const result = gassma.sheets.YOUR_SHEET_NAME.findMany({
    where: {
      city: "Tokyo", // filter: city equals Tokyo
      age: 22         // filter: age equals 22
    }
  });

  console.log(result); // log the retrieved records
}

Using in the GAS Script Editor

// Create a client
const gassma = new Gassma.GassmaClient();

// Fetch data from the Spreadsheet (findMany)
function myFunction(){
  const result = gassma.sheets.YOUR_SHEET_NAME.findMany({
    where: {
      city: "Tokyo", // filter: city equals Tokyo
      age: 22         // filter: age equals 22
    }
  });

  console.log(result); // log the retrieved records
}