Implement mvcc_checkpoint_threshold pragma

This commit is contained in:
bit-aloo
2025-10-07 10:11:53 +05:30
parent 551dbf518e
commit 68b6ffe57c

View File

@@ -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))
},
}
}