pub async fn status(
source_url: &str,
target_url: &str,
filter: Option<ReplicationFilter>,
) -> Result<()>Expand description
Check replication status and display health information
This command performs Phase 4 of the migration process:
- Discovers databases and filters them based on criteria
- For each filtered database:
- Queries pg_stat_replication on source for replication lag
- Queries pg_stat_subscription on target for subscription status
- Displays health information in human-readable format
Provides real-time monitoring of replication health including:
- Replication lag (write/flush/replay) per database
- Subscription state per database
- Whether each database is caught up with source
§Arguments
source_url- PostgreSQL connection string for source databasetarget_url- PostgreSQL connection string for target (Seren) databasefilter- Optional replication filter for database selection
§Returns
Returns Ok(()) after displaying status information.
§Errors
This function will return an error if:
- Cannot connect to source or target database
- Cannot discover databases on source
- Cannot query replication statistics
- Cannot query subscription status
§Examples
// Show status for all databases
status(
"postgresql://user:pass@source.example.com/postgres",
"postgresql://user:pass@target.example.com/postgres",
None
).await?;
// Show status for specific databases only
let filter = ReplicationFilter::new(
Some(vec!["mydb".to_string(), "analytics".to_string()]),
None,
None,
None,
)?;
status(
"postgresql://user:pass@source.example.com/postgres",
"postgresql://user:pass@target.example.com/postgres",
Some(filter)
).await?;