© 2026 Hedgehog Software, LLC

TwitterGitHubDiscord
More
CommunitiesDocsAboutTermsPrivacy
Search
Star
Setup for Free
SupabaseS
Supabase•3mo ago•
6 replies
In&Out

Need help setting up realtime

edge functionsrealtime
Hey folks, I am making a docs builder webapp and currently making realtime editing, but per block not per character. My issue is, im storing content of each page as a JSONB, and i am not sure how would i go on about with it, since i know you cant check realtime for JSONB properties, i want to know how to solve this? Here is the table for where i store the content:
create table public.pages (
  id uuid not null default gen_random_uuid (),
  created_at timestamp with time zone not null default now(),
  updated_at timestamp with time zone not null default now(),
  project_id uuid not null,
  section_id uuid not null,
  parent_page_id uuid null,
  title text not null default 'Untitled'::text,
  slug text not null,
  icon text null default 'FileText'::text,
  created_by uuid not null,
  last_edited_by uuid null,
  content jsonb not null default '[{"id": "Header 1-1", "type": "Header 1", "level": 1, "title": "Main Heading", "subtitle": "Subtitle for main heading", "createdAt": 1759941339328}]'::jsonb,
  position integer not null default 0,

  -- you can ignore stuff from here
  constraint pages_pkey primary key (id),
  constraint pages_project_section_slug_unique unique (project_id, section_id, slug, parent_page_id),
  constraint pages_last_edited_by_fkey foreign KEY (last_edited_by) references users (user_id) on delete set null,
  constraint pages_parent_page_id_fkey foreign KEY (parent_page_id) references pages (id) on delete CASCADE,
  constraint pages_created_by_fkey foreign KEY (created_by) references users (user_id) on delete RESTRICT,
  constraint pages_project_id_fkey foreign KEY (project_id) references projects (id) on delete CASCADE,
  constraint pages_section_id_fkey foreign KEY (section_id) references sections (id) on delete CASCADE
) TABLESPACE pg_default;
create table public.pages (
  id uuid not null default gen_random_uuid (),
  created_at timestamp with time zone not null default now(),
  updated_at timestamp with time zone not null default now(),
  project_id uuid not null,
  section_id uuid not null,
  parent_page_id uuid null,
  title text not null default 'Untitled'::text,
  slug text not null,
  icon text null default 'FileText'::text,
  created_by uuid not null,
  last_edited_by uuid null,
  content jsonb not null default '[{"id": "Header 1-1", "type": "Header 1", "level": 1, "title": "Main Heading", "subtitle": "Subtitle for main heading", "createdAt": 1759941339328}]'::jsonb,
  position integer not null default 0,

  -- you can ignore stuff from here
  constraint pages_pkey primary key (id),
  constraint pages_project_section_slug_unique unique (project_id, section_id, slug, parent_page_id),
  constraint pages_last_edited_by_fkey foreign KEY (last_edited_by) references users (user_id) on delete set null,
  constraint pages_parent_page_id_fkey foreign KEY (parent_page_id) references pages (id) on delete CASCADE,
  constraint pages_created_by_fkey foreign KEY (created_by) references users (user_id) on delete RESTRICT,
  constraint pages_project_id_fkey foreign KEY (project_id) references projects (id) on delete CASCADE,
  constraint pages_section_id_fkey foreign KEY (section_id) references sections (id) on delete CASCADE
) TABLESPACE pg_default;
Supabase banner
SupabaseJoin
Supabase gives you the tools, documentation, and community that makes managing databases, authentication, and backend infrastructure a lot less overwhelming.
45,816Members
Resources
Was this page helpful?

Similar Threads

Recent Announcements

Similar Threads

Need help setting up Auth0
SupabaseSSupabase / help-and-questions
5mo ago
need help setting up supabase credentials in n8n.
SupabaseSSupabase / help-and-questions
11mo ago
Need help setting up GoDaddy Microsoft 365 SMTP (Upstream Error)
SupabaseSSupabase / help-and-questions
5mo ago
Realtime views follow-up
SupabaseSSupabase / help-and-questions
5mo ago