Search documentation

Find a page in the Andurel docs.

db

Andurel wraps PostgreSQL lifecycle, embedded Goose migrations, and named seed operations under andurel db.

Database lifecycle

1andurel db create
2andurel db drop
3andurel db nuke
4andurel db rebuild
5andurel db rebuild --skip-seed

Human output for create:

1Database "orbit" created successfully.

rebuild drops and recreates the configured database, applies migrations, and runs a seed. Destructive commands prompt by default; --force permits protected system-database names and should be reserved for explicit automation.

1Database "orbit" rebuilt successfully.

Migrations

Create a new SQL migration with the generator, then apply it:

1andurel generate migration add_status_to_products
2andurel db migrate up
3andurel db migrate down
4andurel db migrate status
5andurel db migrate reset
6andurel db migrate up-to 12
7andurel db migrate down-to 8
8andurel db migrate fix

Creating the SQL file is generate migration; applying and rolling back is andurel db migrate.

migrate shells out to the pinned bin/goose against root migrations/. Goose status looks like:

1    Applied At                  Migration
2    =======================================
3    2026-09-23 14:02:11         00001_create_river_migration_table.sql
4    2026-09-23 14:02:11         00002_create_river_job_and_leader_tables.sql
5    Pending                     00015_add_status_to_products.sql

After migrate up, Goose prints each applied version:

1OK   00015_add_status_to_products.sql (12.4ms)

Migrations are SQL files in root migrations/ and are embedded by the migrations package. See Migrations & Seeding.

Named seeds

1andurel db seed
2andurel db seed development
3andurel db seed --list
4andurel db rebuild --seed test

--list and named runs emit structured summaries when you pass --json:

1andurel db seed --list --json
1{
2  "ok": true,
3  "data": {
4    "names": ["default", "development", "test"]
5  },
6  "summary": "Found 3 seed sets"
7}
1andurel db seed development --json
1{
2  "ok": true,
3  "data": {
4    "name": "development",
5    "output": ["seeded development users"]
6  },
7  "summary": "Ran \"development\" seed"
8}

Root seeds/ owns the registry and composes model factories. Keep test, development, and production-safe seed intent separate.

Inspect the database

1andurel db console
2andurel tool dblab

Both use the current project connection settings. db console opens usql; dblab opens the terminal database UI.