Merge 'bench/insert: fix expected return value from pragma' from Jussi Saurio

CI did not fail when this panicked :]

Reviewed-by: Preston Thorpe <preston@turso.tech>

Closes #2489
This commit is contained in:
Preston Thorpe
2025-08-07 21:34:13 -04:00
committed by GitHub

View File

@@ -551,14 +551,18 @@ fn bench_insert_rows(criterion: &mut Criterion) {
sqlite_conn
.pragma_update(None, "journal_mode", "WAL")
.unwrap();
sqlite_conn
.pragma_update(None, "locking_mode", "EXCLUSIVE")
.unwrap();
let journal_mode = sqlite_conn
.pragma_query_value(None, "journal_mode", |row| row.get::<_, String>(0))
.unwrap();
assert_eq!(journal_mode.to_lowercase(), "wal");
let synchronous = sqlite_conn
.pragma_query_value(None, "synchronous", |row| row.get::<_, String>(0))
.pragma_query_value(None, "synchronous", |row| row.get::<_, usize>(0))
.unwrap();
assert_eq!(synchronous.to_lowercase(), "full");
const FULL: usize = 2;
assert_eq!(synchronous, FULL);
// Create test table
sqlite_conn
@@ -568,11 +572,6 @@ fn bench_insert_rows(criterion: &mut Criterion) {
.pragma_update(None, "locking_mode", "EXCLUSIVE")
.unwrap();
// Create test table
sqlite_conn
.execute("CREATE TABLE test (id INTEGER, value TEXT)", [])
.unwrap();
group.bench_function(format!("sqlite_insert_{batch_size}_rows"), |b| {
let mut values = String::from("INSERT INTO test VALUES ");
for i in 0..batch_size {