StoicBuilder

HandbookV the OfficinaTest and seed data

Vthe Officina, Use the tools

Test and seed data

1 min readUpdated 28 November

In plain words

Seed data is a set of realistic fake records loaded into a development database, so every screen has something to show and you never test on real people's data.

Where you see it

A supabase/seed.sql file that runs each time you reset your local database with supabase db reset, or a scripts/seed.ts your agent wrote. Good seed data includes the awkward cases: the empty account, the very long name, the user with 5,000 notes.

supabase/seed.sqldatabase
insert into restaurants (name, cuisine, is_open) values ('Pasta Palace', 'Italian', true), ('The Great Northern Noodle and Dumpling House of Greater Manchester', 'Chinese', true), ('Closed for Renovation', null, false); insert into customers (email, full_name) values ('sam.test@example.com', 'Sam Test');
A normal row, a very long name and a missing value. example.com is reserved for testing, so these addresses reach no one.

What goes wrong

  1. Copying production into development

    Real names, emails and addresses on a laptop are a leak waiting to happen. Generate fake data, or anonymise a copy before it leaves production.

  2. Running the reset against the live database

    With --linked, the reset command wipes your linked remote project and reseeds it. Read every reset or seed command for anything that points it at production.

    supabase db reset --linked
  3. Fake users with real email addresses

    jane.smith@gmail.com is almost certainly someone's real inbox, and your welcome email will find it. Use example.com, which exists for exactly this.

What to tell your agent

Copy this into Lovable, Bolt, Cursor or any agent
Write a seed script for local development with realistic fake data: a few normal accounts, one empty account, one with very long names and one with 2,000 records. Use example.com emails only, and make the script refuse to run if it's pointed at the production database.

Quick check

Sign in to earn +10 XP for it

Your seed script creates 50 test users with addresses like sam@gmail.com, and your app sends welcome emails. What's the risk?

Got a prompt that touches test and seed data?

Paste it. You get a better prompt first, then the cards that explain it.

Check your own prompt

Free, no sign-up.