MCPcopy Create free account
hub / github.com/MaterializeInc/materialize / increment_lsn

Function increment_lsn

src/sql-server-util/src/inspect.rs:175–183  ·  view source on GitHub ↗

Increments the log sequence number. See:

(client: &mut Client, lsn: Lsn)

Source from the content-addressed store, hash-verified

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>
175pub 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///

Callers

nothing calls this directly

Calls 4

parse_lsnFunction · 0.85
as_sliceMethod · 0.80
queryMethod · 0.45
as_bytesMethod · 0.45

Tested by

no test coverage detected