Function cleanup_change_table

Source
pub async fn cleanup_change_table(
    client: &mut Client,
    capture_instance: &str,
    low_water_mark: &Lsn,
    max_deletes: u32,
) -> Result<(), SqlServerError>
Expand description

Cleans up the change table associated with the specified capture_instance by deleting max_deletes entries with a start_lsn less than low_water_mark.

Note: At the moment cleanup is kind of “best effort”. If this query succeeds then at most max_delete rows were deleted, but the number of actual rows deleted is not returned as part of the query. The number of rows should be present in an informational message (i.e. a Notice) that is returned, but tiberius doesn’t expose these to us.

TODO(sql_server2): Update tiberius to return informational messages so we can determine how many rows got deleted.

See: https://learn.microsoft.com/en-us/sql/relational-databases/system-stored-procedures/sys-sp-cdc-cleanup-change-table-transact-sql?view=sql-server-ver16.