pub async fn verify(
source_url: &str,
target_url: &str,
filter: Option<ReplicationFilter>,
) -> Result<()>Expand description
Verify data integrity between source and target databases
This command performs Phase 5 of the migration process:
- Discovers databases and filters them based on criteria
- For each filtered database:
- Lists all tables and filters them
- Compares each table’s checksum between source and target
- Reports any mismatches or missing tables
- Provides overall validation summary across all databases
Uses parallel verification (up to 4 concurrent table checks) with progress bars for efficient processing of large databases.
§Arguments
source_url- PostgreSQL connection string for source databasetarget_url- PostgreSQL connection string for target (Seren) databasefilter- Optional replication filter for database and table selection
§Returns
Returns Ok(()) if all tables match or after displaying verification results.
§Errors
This function will return an error if:
- Cannot connect to source or target database
- Cannot discover databases on source
- Cannot list tables from source
- Table comparison fails due to connection issues
§Examples
// Verify all databases
verify(
"postgresql://user:pass@source.example.com/postgres",
"postgresql://user:pass@target.example.com/postgres",
None
).await?;
// Verify only specific databases
let filter = ReplicationFilter::new(
Some(vec!["mydb".to_string(), "analytics".to_string()]),
None,
None,
None,
)?;
verify(
"postgresql://user:pass@source.example.com/postgres",
"postgresql://user:pass@target.example.com/postgres",
Some(filter)
).await?;