Queries the specified capture instance and returns all changes from `[start_lsn, end_lsn)`, ordered by `start_lsn` in an ascending fashion.
(
client: &mut Client,
capture_instance: &str,
start_lsn: Lsn,
end_lsn: Lsn,
filter: RowFilterOption,
)
| 233 | /// Queries the specified capture instance and returns all changes from |
| 234 | /// `[start_lsn, end_lsn)`, ordered by `start_lsn` in an ascending fashion. |
| 235 | pub fn get_changes_asc( |
| 236 | client: &mut Client, |
| 237 | capture_instance: &str, |
| 238 | start_lsn: Lsn, |
| 239 | end_lsn: Lsn, |
| 240 | filter: RowFilterOption, |
| 241 | ) -> impl Stream<Item = Result<tiberius::Row, SqlServerError>> + Send { |
| 242 | const START_LSN_COLUMN: &str = "__$start_lsn"; |
| 243 | let query = format!( |
| 244 | "SELECT * FROM cdc.{function}(@P1, @P2, N'{filter}') ORDER BY {START_LSN_COLUMN} ASC;", |
| 245 | function = quote_identifier(&format!("fn_cdc_get_all_changes_{capture_instance}")) |
| 246 | ); |
| 247 | client.query_streaming( |
| 248 | query, |
| 249 | &[ |
| 250 | &start_lsn.as_bytes().as_slice(), |
| 251 | &end_lsn.as_bytes().as_slice(), |
| 252 | ], |
| 253 | ) |
| 254 | } |
| 255 | |
| 256 | /// Cleans up the change table associated with the specified `capture_instance` by |
| 257 | /// deleting `max_deletes` entries with a `start_lsn` less than `low_water_mark`. |
nothing calls this directly
no test coverage detected