stable

supabase

Supabase adapter for noy-db — a thin factory over to-postgres for the Postgres connection you already have, inheriting its full feature set.

@noy-db/to-supabase · pnpm add @noy-db/to-supabase Postgres + Storage combo, built on to-postgres.

Shaperecord
Atomic CAS✓
Localitycloud
Speedmedium
Persistencedurable

What it does

A thin factory over @noy-db/to-postgres for the Postgres connection you already have (pg.Pool, Supabase's serverless driver, …), with optional blob routing via Supabase Storage.

Notes

  • casAtomic: true — delegates CAS to to-postgres (UPDATE … WHERE v = ? RETURNING id).
  • Record shape, one row per record — inherits the full to-postgres feature set.
  • Factory: toSupabase(options: SupabaseStoreOptions).

Store-locator descriptor

See store-locator descriptors for the general model. kind: 'supabase', class: 'cloud'. address is { projectRef?, schema?, table? }: table maps to tableName; projectRef and schema are identity-only, not consumed by the factory — the connection already carries them. projectRef is the stable identifier (a full URL is derivable from it). options is { autoMigrate? }. binding.client is required (a PostgresClient) — this store has no client library of its own; resolve() without it throws.

import { supabaseStoreDescriptor, registerSupabaseStore } from '@noy-db/to-supabase'

const descriptor = supabaseStoreDescriptor({ projectRef: 'abcxyz', schema: 'public' })

See also