What You Can See
The Schema Viewer surfaces all the structural details of your database:Columns and Data Types
Every column is listed with its PostgreSQL data type. Common types you’ll encounter:| Type | Used For |
|---|---|
text | Strings — names, descriptions, content |
integer / bigint | Whole numbers — counts, quantities |
boolean | True/false flags |
uuid | Unique identifiers — primary keys, references |
timestamp / timestamptz | Dates and times — created_at, updated_at |
jsonb | Structured JSON data — metadata, settings |
float / numeric | Decimal numbers — prices, coordinates |
text[] / integer[] | Arrays of values — tags, categories |
Keys and Constraints
- Primary keys — The unique identifier for each row, typically
id - Foreign keys — References to rows in other tables, defining relationships
- Unique constraints — Columns that must have distinct values across all rows
- Not-null constraints — Columns that cannot be empty
- Check constraints — Rules that validate column values (e.g., price must be positive)
Default Values
See which columns have default values set. Common defaults include:| Default | Used On |
|---|---|
now() | Timestamp columns like created_at |
gen_random_uuid() | UUID primary keys |
true / false | Boolean flags |
'draft' | Status columns with an initial state |
0 | Numeric counters |
Indexes
View the indexes on each table. Indexes speed up queries on frequently searched columns. The Schema Viewer shows which columns are indexed so you can understand your database’s performance characteristics. Common indexes you’ll see:- Primary key index — Created automatically on every primary key
- Foreign key indexes — Often added to speed up JOIN queries
- Unique indexes — Enforce uniqueness and speed up lookups (e.g., on
email) - Custom indexes — Added for columns you query frequently
Row Level Security (RLS) Policies
Supabase uses RLS to control who can read and write data. The Schema Viewer shows you:- Whether RLS is enabled on a table
- What policies are defined
- What operations each policy allows (SELECT, INSERT, UPDATE, DELETE)
- The conditions for each policy
Relationships Between Tables
See how your tables connect to each other through foreign keys. This is critical for understanding your data model — which table references which, and how records relate across tables. For example, ifposts.author_id references users.id, the Schema Viewer shows that relationship so you can understand the connection between posts and users.
Why It Matters
The Schema Viewer isn’t just informational. It directly helps you build better apps:Verify the AI’s Work
When you ask the AI to create a table or add columns, open the Schema Viewer to confirm it did exactly what you expected. Check that column types are correct, foreign keys point to the right tables, and RLS policies are in place.Plan New Features
Before asking the AI to add a new feature that touches the database, review the existing schema. Understanding what tables and columns already exist helps you write better prompts and avoid duplicate structures.Debug Data Issues
When something isn’t working right, the schema often holds the answer. A column might be the wrong type, a foreign key might be missing, or RLS might be blocking access.Example Workflow
Here’s how the Schema Viewer fits into a typical build session:- You ask the AI: “Create a posts table with title, body, and author”
- The AI generates a migration and applies it
- You open the Schema Viewer to verify the table structure
- You notice the AI used
textforauthorinstead of a foreign key tousers - You ask the AI: “Change author to a uuid foreign key referencing users.id”
- You verify the updated schema in the Schema Viewer
Reading the Schema Effectively
When you open the Schema Viewer for a table, here’s a systematic way to read it:- Start with the primary key — Usually
idwith typeuuid. This confirms the table’s identity column. - Look at foreign keys — These tell you how the table relates to others. A
user_id uuid REFERENCES users(id)column means each row belongs to a user. - Check data types — Make sure they match your expectations. A
pricecolumn should benumeric, nottext. - Review nullability — Columns marked NOT NULL are required. Nullable columns are optional. This affects how your app handles forms and validation.
- Check RLS — If RLS is enabled, review the policies to understand access control.
Schema Viewer vs. Data Browser
These two tools are complementary:| Schema Viewer | Data Browser |
|---|---|
| Shows table structure | Shows table data |
| Column names and types | Actual row values |
| Relationships and constraints | Live records |
| Answers “what does this table look like?” | Answers “what’s in this table?” |
The Schema Viewer reflects the current state of your database. If you apply a
migration that adds a column, the Schema Viewer shows it immediately.
Related
Database Overview
Learn about all the database management tools available in Nativeline.
Data Browser
View the actual data stored in your tables.