Skip to main content

Module seed

Module seed 

Source
Expand description

seed --dataset NAME and seed --list: datasets the application registers with AppCli::seed, loaded only when asked for, into the database the global flags select.

A seed is not a migration: nothing is recorded in the migration history and there is no rollback. Nothing is deleted or reset first, and no SQL file is read; the callback decides what to write. The dataset runs in one transaction whenever the backend has transactions (SQLite, PostgreSQL and MySQL do), so a failing seed leaves nothing behind. Datasets should be idempotent (look up before inserting, or rely on unique keys) so running one twice is harmless.

Structs§

Seeding
What a dataset receives.

Type Aliases§

SeedError
What a seed callback returns on failure; the message is redacted before it is shown.