Skip to main content

Crate waypoint_core

Crate waypoint_core 

Source
Expand description

Lightweight, Flyway-compatible PostgreSQL migration library.

§Quick Start

use waypoint_core::config::WaypointConfig;
use waypoint_core::Waypoint;

let config = WaypointConfig::load(None, None)?;
let wp = Waypoint::new(config).await?;
let report = wp.migrate(None).await?;
println!("Applied {} migrations", report.migrations_applied);

§Architecture

  • config — Configuration loading (TOML, env vars, CLI overrides)
  • migration — Migration file parsing and scanning
  • db — Database connections, TLS, advisory locks
  • history — Schema history table operations
  • commands — Individual command implementations
  • checksum — CRC32 checksums (Flyway-compatible)
  • placeholder${key} placeholder replacement in SQL
  • hooks — SQL callback hooks (before/after migrate)
  • directive-- waypoint:* comment directive parsing
  • guard — Guard expression parser and evaluator for pre/post conditions
  • sql_parser — Regex-based DDL extraction
  • safety — Migration safety analysis (lock levels, impact, verdicts)
  • schema — PostgreSQL schema introspection + diff
  • dependency — Migration dependency graph
  • preflight — Pre-migration health checks
  • multi — Multi-database orchestration
  • error — Error types

Re-exports§

pub use advisor::AdvisorReport;
pub use commands::changelog::ChangelogReport;
pub use commands::check_conflicts::ConflictReport;
pub use commands::diff::DiffReport;
pub use commands::drift::DriftReport;
pub use commands::explain::ExplainReport;
pub use commands::info::MigrationInfo;
pub use commands::info::MigrationState;
pub use commands::lint::LintReport;
pub use commands::migrate::MigrateReport;
pub use commands::repair::RepairReport;
pub use commands::safety::SafetyCommandReport;
pub use commands::simulate::SimulationReport;
pub use commands::snapshot::RestoreReport;
pub use commands::snapshot::SnapshotReport;
pub use commands::undo::UndoReport;
pub use commands::undo::UndoTarget;
pub use commands::validate::ValidateReport;
pub use config::CliOverrides;
pub use multi::MultiWaypoint;
pub use preflight::PreflightReport;
pub use safety::SafetyReport;

Modules§

advisor
Schema advisor: proactive suggestions for schema improvements.
checksum
CRC32 checksum calculation, compatible with Flyway’s line-by-line algorithm.
commands
Command implementations: migrate, info, validate, repair, baseline, clean, lint, changelog, diff, drift, snapshot, explain, preflight, check-conflicts, safety, advisor, simulate.
config
Configuration loading and resolution.
db
Database connection, TLS support, advisory locking, and transaction execution.
dependency
Migration dependency graph with topological sort.
directive
Parse -- waypoint:* comment directives from SQL file headers.
error
Error types for Waypoint operations.
guard
Guard expression parser and evaluator for migration pre/post conditions.
history
Schema history table operations (create, query, insert, update, delete).
hooks
SQL callback hooks that run before/after migrations (Flyway-compatible).
migration
Migration file parsing, scanning, and types.
multi
Multi-database orchestration.
placeholder
Placeholder replacement in SQL (${key} syntax).
preflight
Pre-flight health checks run before migrations.
reversal
Auto-reversal generation from schema diffs.
safety
Migration safety analysis: lock levels, impact estimation, and verdicts.
schema
PostgreSQL schema introspection, diff, and DDL generation.
sql_parser
Lightweight regex-based DDL extraction from SQL content.

Structs§

Waypoint
Main entry point for the Waypoint library.