Skip to content

Supabase Storage

OpenSheets supports optional cloud storage via Supabase, a hosted PostgreSQL backend. When configured, spreadsheet data is saved to a Supabase table and can be loaded from any device.

Opening Settings

Open via File > Storage Settings in the menu bar. The settings dialog lets you configure, test, and manage your Supabase connection.

Setup

1. Create a Supabase Table

In your Supabase project, create a table with this schema:

CREATE TABLE spreadsheets (
  id TEXT PRIMARY KEY,
  data JSONB,
  updated_at TIMESTAMPTZ
);

Enable Row Level Security (RLS) policies as needed for your use case.

2. Configure Connection

In the settings dialog, enter:

Field Description
Supabase URL Your project URL, e.g. https://xxxxx.supabase.co
Anon / Public Key The anon key from your Supabase project settings
Table Name The table name (default: spreadsheets)

Click Test Connection to verify the settings, then Save Settings to persist them to localStorage.

Features

Auto-Save

When enabled (on by default), OpenSheets checks for unsaved changes every 30 seconds and automatically saves to Supabase. The auto-save toggle is available in the settings dialog.

Changes are tracked by listening to cell edits, undo/redo, sheet operations, and other modification events.

Sync Status Indicator

A colored dot appears next to the save button in the toolbar:

Color State Meaning
Green Synced All changes are saved
Orange Unsaved Local changes not yet saved
Spinning Saving Save in progress
Red Error Last save failed
Gray Offline Not connected to Supabase

Conflict Detection

Before saving, OpenSheets checks the server's updated_at timestamp. If the document was modified externally since your last save, a prompt offers two choices:

  • Overwrite: Save your version, replacing the server copy.
  • Load server version: Discard your local changes and load the latest from Supabase.

Document Management

The settings dialog includes a document list showing all saved spreadsheets with:

  • Document title and ID
  • Last updated timestamp
  • File size in KB

Each document supports these actions:

  • Load: Open the document in the current session.
  • Rename: Change the document title.
  • Duplicate: Create a copy with a new ID.
  • Delete: Permanently remove from Supabase.

Use the search bar and sort buttons (Name, Date, Size) to find documents quickly.

Import / Export Backups

  • Download Backup: Save the complete workbook as a local JSON file.
  • Upload Backup: Restore a workbook from a previously downloaded JSON file.

Connection Health Monitoring

A health check runs every 60 seconds in the background. The connection status is displayed in the settings dialog and reflected in the sync indicator.

What Is Stored in Supabase

Only cell and sheet data is stored in Supabase:

  • Sheet names, cell values, formulas, and formatting
  • Data validation rules, conditional formatting
  • Sheet protection settings

Configuration items (saved queries, forms, custom scripts, chart positions) are stored in the URL hash, not in Supabase. This separation keeps the database payload focused on data while portable configuration travels with the link.

Disabling Supabase

Click Disable / Clear in the settings dialog to remove all connection settings. Data will be saved exclusively to the URL hash and browser localStorage.