Skip to main content

vespertide_loader/
lib.rs

1//! Filesystem loading of vespertide models and migrations.
2//!
3//! Supports both JSON and YAML model/migration files. Used by both the CLI
4//! at runtime and the `vespertide_migration!` macro at compile time.
5
6// Test-only env mutation in `migrations.rs` / `models.rs` uses
7// `std::env::set_var` / `remove_var`, which became `unsafe` in Rust 2024.
8// All sites are serialized via `serial_test::serial`, so expect unsafe in tests only.
9#![cfg_attr(
10    test,
11    expect(
12        unsafe_code,
13        reason = "serial_test serializes Rust 2024 std::env var setters used by loader tests"
14    )
15)]
16
17pub mod config;
18pub mod migrations;
19pub mod models;
20mod parallel_config;
21
22pub use config::{load_config, load_config_from_path, load_config_or_default};
23pub use migrations::{load_migrations, load_migrations_at_compile_time, load_migrations_from_dir};
24pub use models::{load_models, load_models_at_compile_time, load_models_from_dir};