Skip to Content
DatabaseOverview

Database

NativeExpress uses Supabase Postgres  for chat history, scan results and generated image records. The app reads them through a typed client and React Query hooks.

Your agent can query this database, run migrations and deploy functions directly. Scope the connection first: see agent tools.

Prerequisites

Complete the Supabase project setup.

The schema

TableHolds
threadsOne row per AI conversation
messagesOne row per chat message, with its parts as JSON
generationsOne row per generated image
scansOne row per scan result

The users entity in the diagram is Supabase Auth’s auth.users table. The boilerplate creates the four tables listed above, two storage buckets, and the count_monthly_usage function used for the free allowance.

The avatars bucket is public. The chat-media bucket is private and holds chat attachments, generated images and scan photos under each user’s ID.

The four tables have owner-scoped row-level security. Queries through the app’s authenticated Supabase client return only the signed-in user’s rows without an extra user_id filter.

Last updated on