Postgres domains

Custom data types

Type a column as `supasheet.RATING` and get a star input. Type it as `supasheet.COLOR` and get a colour picker. Constraints live in the database, not the form code.

supasheet domains
6 built-in
supasheet.EMAILdomain
lena@acme.com
validated email input
supasheet.URLdomain
https://acme.com
parsed url input
supasheet.RATINGdomain
check (0..5)
supasheet.PERCENTAGEdomain
68%
check (0..100)
supasheet.DURATIONdomain
02h 15m
time interval
supasheet.COLORdomain
#F43F5E
hex color picker
What it does

The capabilities you get out of the box.

Capability01

Ten built-in domains

EMAIL, URL, TEL, RICH_TEXT, FILE, AVATAR, RATING, PERCENTAGE, DURATION, COLOR.

Capability02

Validated in Postgres

Check constraints enforce bounds (e.g. RATING between 0 and 5).

Capability03

UI maps automatically

No per-form configuration to pick the right input component.

How it works

Three steps from SQL to UI.

  1. 01
    Type your columnUse a `supasheet.*` domain instead of a primitive.
  2. 02
    Get the componentThe right input renders automatically in create and update forms.
  3. 03
    Trust the dataConstraints are enforced at the database - nothing can sneak past.
example/data-types.sql
sql
-- The supasheet schema ships ten domains.
-- Each one maps to a typed input component automatically.
create table crm.contacts (
  id          uuid primary key default gen_random_uuid(),
  full_name   text not null,
  email       supasheet.EMAIL,        -- validated email input
  website     supasheet.URL,          -- url input
  phone       supasheet.TEL,          -- formatted phone input
  bio         supasheet.RICH_TEXT,    -- Lexical editor
  avatar      supasheet.AVATAR,       -- circular image picker
  files       supasheet.FILE,         -- multi-file uploader
  nps         supasheet.RATING,       -- 0..5 star input
  health      supasheet.PERCENTAGE,   -- 0..100 slider
  duration    supasheet.DURATION,     -- interval input
  brand_color supasheet.COLOR         -- hex colour picker
);

-- Constraints live in the domain (e.g. RATING is 0..5),
-- so bad data cannot sneak past the database.
Get started

Try it on your own Supabase project.

Connect a project, install the Supasheet schema, and your tables are live in minutes.

No credit cardSelf-host or managedMIT licensed