Expand description
Bootstrap system for database seed data.
This crate provides a step-based bootstrap system for initializing database seed data after migrations. Each step can depend on other steps, verify whether its data is present, and is classified as required or optional.
§Example
ⓘ
use database_bootstrap::{BootstrapRunner, RunOptions};
let mut runner = BootstrapRunner::new();
runner.add_step(...)?;
let summary = runner.run(&db, &RunOptions::default()).await?;
for output in summary.outputs {
println!("{}", output.title);
}Structs§
- Bootstrap
Runner - Executes bootstrap steps in dependency order.
- Bootstrap
Summary - Summary of bootstrap execution.
- RunOptions
- Options for bootstrap execution.
- Step
Output - Output from a bootstrap step that should be displayed in the summary.
- Verify
Details - Detailed verification result with entity-level information.
Enums§
- Bootstrap
Error - Bootstrap step execution errors.
- Requirement
- Requirement level for bootstrap step data.
- Verify
Result - Result of verifying whether a bootstrap step’s data exists.
Traits§
- Bootstrap
Step - A single bootstrap step that can verify and create seed data.
- Step
Factory - Factory for creating bootstrap steps.