From 68b6ffe57cac29cb208baaaa46edd74a98d5c051 Mon Sep 17 00:00:00 2001 From: bit-aloo Date: Tue, 7 Oct 2025 10:11:53 +0530 Subject: [PATCH] Implement mvcc_checkpoint_threshold pragma --- core/translate/pragma.rs | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/core/translate/pragma.rs b/core/translate/pragma.rs index d8b26143a..37707533e 100644 --- a/core/translate/pragma.rs +++ b/core/translate/pragma.rs @@ -378,6 +378,15 @@ fn update_pragma( connection.set_data_sync_retry(retry_enabled); Ok((program, TransactionMode::None)) } + PragmaName::MvccCheckpointThreshold => { + let threshold = match parse_signed_number(&value)? { + Value::Integer(size) if size > 0 => size as u64, + _ => bail_parse_error!("mvcc_checkpoint_threshold must be a positive integer"), + }; + + connection.set_mvcc_checkpoint_threshold(threshold)?; + Ok((program, TransactionMode::None)) + } } } @@ -687,6 +696,14 @@ fn query_pragma( program.add_pragma_result_column(pragma.to_string()); Ok((program, TransactionMode::None)) } + PragmaName::MvccCheckpointThreshold => { + let threshold = connection.mvcc_checkpoint_threshold()?; + let register = program.alloc_register(); + program.emit_int(threshold as i64, register); + program.emit_result_row(register, 1); + program.add_pragma_result_column(pragma.to_string()); + Ok((program, TransactionMode::None)) + }, } }