Increments the log sequence number. See:
(client: &mut Client, lsn: Lsn)
| 173 | /// |
| 174 | /// See: <https://learn.microsoft.com/en-us/sql/relational-databases/system-functions/sys-fn-cdc-increment-lsn-transact-sql?view=sql-server-ver16> |
| 175 | pub async fn increment_lsn(client: &mut Client, lsn: Lsn) -> Result<Lsn, SqlServerError> { |
| 176 | static INCREMENT_LSN_QUERY: &str = "SELECT sys.fn_cdc_increment_lsn(@P1);"; |
| 177 | let result = client |
| 178 | .query(INCREMENT_LSN_QUERY, &[&lsn.as_bytes().as_slice()]) |
| 179 | .await?; |
| 180 | |
| 181 | mz_ore::soft_assert_eq_or_log!(result.len(), 1); |
| 182 | parse_lsn(&result[..1]) |
| 183 | } |
| 184 | |
| 185 | /// Parse an [`Lsn`] in Decimal(25,0) format of the provided [`tiberius::Row`]. |
| 186 | /// |