Skip to main content

Crate database_bootstrap

Crate database_bootstrap 

Source
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§

BootstrapRunner
Executes bootstrap steps in dependency order.
BootstrapSummary
Summary of bootstrap execution.
RunOptions
Options for bootstrap execution.
StepOutput
Output from a bootstrap step that should be displayed in the summary.
VerifyDetails
Detailed verification result with entity-level information.

Enums§

BootstrapError
Bootstrap step execution errors.
Requirement
Requirement level for bootstrap step data.
VerifyResult
Result of verifying whether a bootstrap step’s data exists.

Traits§

BootstrapStep
A single bootstrap step that can verify and create seed data.
StepFactory
Factory for creating bootstrap steps.