Skip to main content

Crate sntl_migrate

Crate sntl_migrate 

Source
Expand description

Forward-only SQL migrations for Sentinel ORM.

Two entry points:

  • Migrator::from_dir("migrations/") for the CLI and dev workflows.
  • sntl_migrate::migrate!("./migrations") (re-exported from sntl-macros) for compile-time embedding into a production binary.

See docs/migration-guide.md for the full user guide.

Re-exports§

pub use error::Error;
pub use error::Result;
pub use migration::Migration;
pub use migration::TxMode;
pub use migration::Version;
pub use runner::MigrationReport;
pub use runner::MigrationStatus;
pub use runner::Migrator;
pub use runner::RefreshConfig;
pub use runner::State;

Modules§

checksum
diff
Schema-diff scaffolding: compute structural changes between two sntl_schema::Schema snapshots and emit a SQL skeleton for review.
discover
error
macro_support
Helpers consumed by the sntl_migrate::migrate!() proc-macro.
migration
refresh
runner
tracking

Macros§

migrate
sntl_migrate::migrate!("./migrations") — embed a migrations/ directory into the binary at compile time. Expands to a fully-populated Migrator that uses include_str! for each up.sql / up.notx.sql file.

Constants§

SNTL_MIGRATE_LOCK_ID
The PostgreSQL advisory-lock ID used to serialise concurrent migrators. ASCII bytes “sntlmgrt” — chosen to be unlikely to collide with other tools.