Supabase history inserts

Understand when signed-in ProbeHarbor loads persist probe rows with timestamps, labels, and humidity, and what guests never store.

Home desk with laptop, external monitor, and keyboard in a living space
Household members check the same dashboard from wherever they already work. Photo: David Wellbeloved / Flickr. CC BY 2.0

Historical charts depend on periodic inserts into Supabase Postgres, not on the browser remembering prior values. A scheduled job or edge function polls feeds and writes normalized rows keyed by user and probe.

Insert model

  • Timestamp + user_id + probe_key uniquely identify a sample.
  • Store temp, humidity, units as typed columns for fast chart queries.
  • Skip insert if upstream fetch failed to avoid flatlines at zero.

Auth boundary

Row-level security ties history to signed-in users: Supabase auth flow. Only the service role or trusted server route should insert on schedule.

Consumption

Dashboard reads via history browsing; export via CSV export. Live path: home page fetch.