Skip to main content
You will replace the sample_name_1 rows a new Forge project starts with by rows that read like your shop: real product names, sensible prices, reviews with real text and recent dates, without writing seed SQL for the bulk of it. Forge reads the schema your migrations apply, so it knows every type, foreign key and CHECK constraint. What a column means is the one thing it cannot know, and db/seeds/vocab.yaml is where you say it.

Before you begin

1

Start the stack and let it seed

The first env up on an empty dev database seeds it:
terminal
Output (trimmed)
It seeds 20 rows per table, only for your CRUD entities’ tables and the tables they require through a foreign key. --no-seed skips it for one run.
2

Look at what it wrote

db query runs one read-only statement against an environment’s database:
terminal
Every row is valid and every review points at a real product. But undescribed text reads sample_<column>_<n>, and a numeric column with no CHECK seeds as the row number: a price of one cent.
3

Describe your columns in vocab.yaml

db/seeds/vocab.yaml is yours. Add value pools, numeric ranges and time ranges relative to today:
db/seeds/vocab.yaml
Each value is checked against the schema; an invalid one is skipped with a warning. Keys cannot be set here: the seeder keeps references consistent itself.
4

Add the rows a demo needs

Each column is drawn on its own, so rows are valid but not coherent. Write rows a demo needs in db/seeds/custom/, which runs after the generated rows:
db/seeds/custom/demo.sql
5

Reseed the dev database

db seed apply never changes existing rows. After a vocabulary change, db seed reset deletes the rows Forge seeded and seeds again:
terminal
Rows you or your app created stay, and so does the schema.
6

Verify the data

terminal
Names and prices come from your pool and range, and Chemex 8-Cup Classic is your custom row. Names repeat because five names cover 20 rows; only a UNIQUE column is drawn without repeats. reliant forge db seed status --dsn <url> prints row counts per table.Then run reliant forge generate: the frontend’s mock mode serves the same rows from fixtures that pick up a vocabulary change only on generate.

What this does not do

  • No seeding outside dev. apply and reset refuse every other environment, and the seeder is not in your server binary.
  • No coherent rows from vocab.yaml. A review’s text is unrelated to its rating; rows that must agree belong in db/seeds/custom/.

Troubleshooting

db seed status needs the database named. Pass --dsn with the DATABASE_URL from reliant forge env config dev.
A table reaches one parent through two foreign keys. Decide which route is the truth, add the printed statement in a migration, and seed again.

Next steps

Build the UI before the backend

Serve the same rows to the frontend with no API running

Test against real Postgres

Run handler tests on a real database

Adding a feature

The everyday loop: services, RPCs, migrations, the gate

forge CLI

Every reliant forge command