Skip to content

Database Commands

The db group is the direct live-database workflow.

nautilus db push

Push the current schema state to the database.

text
Usage: nautilus db push [OPTIONS]
OptionMeaning
-s, --schema <SCHEMA>Schema path
--database-url <DATABASE_URL>Database URL override
--accept-data-lossSkip interactive confirmation for destructive changes
--no-generateApply schema changes without generating a client afterwards

nautilus db status

Show pending schema changes without applying them.

text
Usage: nautilus db status [OPTIONS]
OptionMeaning
-s, --schema <SCHEMA>Schema path
--database-url <DATABASE_URL>Database URL override

nautilus db pull

Introspect a live database and write an equivalent .nautilus schema.

text
Usage: nautilus db pull [OPTIONS]
OptionMeaning
-s, --schema <SCHEMA>Optional schema path for datasource lookup
--database-url <DATABASE_URL>Database URL override
-o, --output <OUTPUT>Output file path, default pulled.nautilus
`--model-case <autosnake
`--field-case <autosnake

nautilus db drop

Drop all tables without recreating them.

text
Usage: nautilus db drop [OPTIONS]
OptionMeaning
-s, --schema <SCHEMA>Schema path
--database-url <DATABASE_URL>Database URL override
--forceSkip confirmation

nautilus db reset

Drop and recreate schema state, or truncate data only.

text
Usage: nautilus db reset [OPTIONS]
OptionMeaning
-s, --schema <SCHEMA>Schema path
--database-url <DATABASE_URL>Database URL override
--forceSkip confirmation
--only-dataDelete rows but keep table structure

nautilus db seed

Run a SQL seed script.

text
Usage: nautilus db seed [OPTIONS] <FILE>
OptionMeaning
<FILE>Path to the SQL file
--database-url <DATABASE_URL>Database URL override

Practical Advice

  • use db status before risky pushes
  • on PostgreSQL, review extension diffs carefully; undeclared live extensions are destructive drops unless preserve_extensions = true
  • reserve db drop and db reset for deliberate cleanup
  • use db pull when adopting Nautilus against an existing database
  • use db seed only for raw SQL seeding, not schema definition

Based on the upstream Nautilus project by nautilus-env.