pub struct MultiWaypoint {
pub databases: Vec<NamedDatabaseConfig>,
}Expand description
Multi-database orchestration entry point.
Fields§
§databases: Vec<NamedDatabaseConfig>List of all database configurations to orchestrate.
Implementations§
Source§impl MultiWaypoint
impl MultiWaypoint
Sourcepub fn execution_order(databases: &[NamedDatabaseConfig]) -> Result<Vec<String>>
pub fn execution_order(databases: &[NamedDatabaseConfig]) -> Result<Vec<String>>
Determine execution order based on depends_on relationships (Kahn’s algorithm).
Databases that are ready at the same moment run in declaration order
— the order they appear in [[databases]] — which makes the result
deterministic.
The ready set used to be seeded by iterating a HashMap, whose order is
randomly seeded per process, so three independent databases migrated in
a different order on almost every run. Any topological order is correct,
but a varying one makes --fail-fast leave a different subset migrated
each time, and makes staging and production disagree for no reason.
Uses borrowed &str references internally to avoid cloning database names
during the topological sort; only clones into owned Strings for the output.
Sourcepub async fn connect(
databases: &[NamedDatabaseConfig],
filter: Option<&str>,
) -> Result<HashMap<String, DbClient>>
pub async fn connect( databases: &[NamedDatabaseConfig], filter: Option<&str>, ) -> Result<HashMap<String, DbClient>>
Connect to all databases (or a filtered subset). The engine for each database is auto-detected from the URL scheme — mixed PG/MySQL configs are fully supported here.
Uses built-in defaults for the global config sections. Prefer
Self::connect_inheriting so that top-level [database] transport
settings apply.
Sourcepub async fn connect_inheriting(
databases: &[NamedDatabaseConfig],
filter: Option<&str>,
parent: &WaypointConfig,
) -> Result<HashMap<String, DbClient>>
pub async fn connect_inheriting( databases: &[NamedDatabaseConfig], filter: Option<&str>, parent: &WaypointConfig, ) -> Result<HashMap<String, DbClient>>
Like Self::connect, but inheriting global sections from parent.
Sourcepub async fn migrate(
databases: &[NamedDatabaseConfig],
clients: &HashMap<String, DbClient>,
order: &[String],
target_version: Option<&str>,
fail_fast: bool,
) -> Result<MultiResult>
pub async fn migrate( databases: &[NamedDatabaseConfig], clients: &HashMap<String, DbClient>, order: &[String], target_version: Option<&str>, fail_fast: bool, ) -> Result<MultiResult>
Run migrate on all databases in dependency order.
Sourcepub async fn migrate_with_options(
databases: &[NamedDatabaseConfig],
clients: &HashMap<String, DbClient>,
order: &[String],
target_version: Option<&str>,
fail_fast: bool,
force: bool,
) -> Result<MultiResult>
pub async fn migrate_with_options( databases: &[NamedDatabaseConfig], clients: &HashMap<String, DbClient>, order: &[String], target_version: Option<&str>, fail_fast: bool, force: bool, ) -> Result<MultiResult>
Run migrate on all databases in dependency order with the force
flag for overriding DANGER safety verdicts on PostgreSQL.
Uses built-in defaults for the global config sections. Prefer
Self::migrate_inheriting so that top-level [safety],
[preflight], [guards] and [reversals] policy applies.
Sourcepub async fn migrate_inheriting(
databases: &[NamedDatabaseConfig],
clients: &HashMap<String, DbClient>,
order: &[String],
target_version: Option<&str>,
fail_fast: bool,
force: bool,
parent: &WaypointConfig,
) -> Result<MultiResult>
pub async fn migrate_inheriting( databases: &[NamedDatabaseConfig], clients: &HashMap<String, DbClient>, order: &[String], target_version: Option<&str>, fail_fast: bool, force: bool, parent: &WaypointConfig, ) -> Result<MultiResult>
Like Self::migrate_with_options, but inheriting global config
sections from parent.
Sourcepub async fn info(
databases: &[NamedDatabaseConfig],
clients: &HashMap<String, DbClient>,
order: &[String],
) -> Result<HashMap<String, Vec<MigrationInfo>>>
pub async fn info( databases: &[NamedDatabaseConfig], clients: &HashMap<String, DbClient>, order: &[String], ) -> Result<HashMap<String, Vec<MigrationInfo>>>
Run info on all databases in dependency order.
Sourcepub async fn info_inheriting(
databases: &[NamedDatabaseConfig],
clients: &HashMap<String, DbClient>,
order: &[String],
parent: &WaypointConfig,
) -> Result<HashMap<String, Vec<MigrationInfo>>>
pub async fn info_inheriting( databases: &[NamedDatabaseConfig], clients: &HashMap<String, DbClient>, order: &[String], parent: &WaypointConfig, ) -> Result<HashMap<String, Vec<MigrationInfo>>>
Like Self::info, but inheriting global config sections from parent.