Opinionated SQLite cache layer for Google Sheets data, designed for local development workflow where schema changes frequently. Version 9.0.0 is stable, actively maintained on GitHub. Ships TypeScript types. Provides a one-time load from Google Sheets into a local SQLite database, then allows querying via better-sqlite3. Unlike direct API queries, it avoids runtime dependency on Google Sheets and enables fast iteration. Requires API key, doc ID, and sheet ID. Uses a configurable map function to transform rows. Returns a better-sqlite3 database object for querying.
npm install sqlite-cache-for-google-sheetsNo compatibility data collected yet for this library.
Verified import paths — ran on the pinned version, not inferred.
Shows loading data from Google Sheets into a local SQLite database and querying it.
Capture the return value and use it directly for queries.
Ensure the directory exists and is writable.
Use row.get('columnName') instead of row.columnName.Cast values in SQL queries (e.g., CAST(value AS INTEGER)).
import { createDatabase } from 'sqlite-cache-for-google-sheets'npm install better-sqlite3
Set SHEETS_API_KEY in environment or config.apiKey.