mirror of
https://github.com/aljazceru/turso.git
synced 2025-12-25 03:54:21 +01:00
Implement mvcc_checkpoint_threshold pragma
This commit is contained in:
@@ -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))
|
||||
},
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user