Skip to content

Minimal Google Apps Script (GAS) project intended to quickly transform a Google Sheet into a SQLite database.

Notifications You must be signed in to change notification settings

ardislu/sheets-db

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

89 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

sheets-db

sheets-db logo

Minimal Google Apps Script (GAS) project intended to quickly transform a Google Sheet into a SQLite database.

Click here to create a copy of the demo Google Sheet (the required GAS code will also be copied).

Requirements

  • A Google Sheet to attach this Google Apps Script project to

Initial setup

These steps only need to be completed once.

Setting up the Google Sheet

  1. Create a new Google Sheet or create a copy of the demo Google Sheet.
  2. Go to Extensions > Apps Script to create a new Google Apps Script (GAS) project. The GAS project is automatically attached to the Google Sheet.
  3. Copy Code.gs and sidebar.html into the GAS project and save. If you copied the demo Google Sheet, this code should already be there.

(OPTIONAL) Setting up "Upload .sqlite3 file to Backblaze"

If you use Backblaze as a storage provider, you can use the "Upload .sqlite3 file to Backblaze" button to upload the SQLite database directly to Backblaze.

This setup is NOT necessary if you only want to generate SQLite databases.

  1. In Backblaze, create a new application key with write access to the storage bucket where you want to upload the file to.
  2. Note the keyID and applicationKey shown.
  3. In the GAS editor, create the following Google Apps Script properties (environment variables) under Project Settings > Script Properties:
  • BACKBLAZE_ID - the Backblaze application key ID (keyId) from step 5.
  • BACKBLAZE_KEY - the Backblaze application key (applicationKey) from step 5.

Usage

  1. Refresh the Google Sheet and wait for the GAS code to finish loading.
  2. See the new custom menu button 🔥 sheets-db. Press 🔥 sheets-db > ❓ Help for end-user instructions.
  3. Press 🔥 sheets-db > 🟢 Start to initialize the SQLite sidebar.
  4. Click the buttons on the sidebar to generate the SQLite database and/or upload the file to Backblaze.
  5. Upload the .sqlite3 file to your favorite SQLite client (example: sqliteviz), to run queries on the database.

About

Minimal Google Apps Script (GAS) project intended to quickly transform a Google Sheet into a SQLite database.

Topics

Resources

Stars

Watchers

Forks