MCPcopy Create free account
hub / github.com/f0rr0/oliphaunt / parsed_text_updates

Function parsed_text_updates

xtask/src/main.rs:3291–3316  ·  view source on GitHub ↗
(limit: usize)

Source from the content-addressed store, hash-verified

3289}
3290
3291fn parsed_text_updates(limit: usize) -> Result<Vec<(i32, String)>> {
3292 let sql = read_pglite_benchmark_sql("10")?;
3293 let mut updates = Vec::with_capacity(limit);
3294 for line in sql.lines() {
3295 let line = line.trim();
3296 let Some(rest) = line.strip_prefix("UPDATE t2 SET c='") else {
3297 continue;
3298 };
3299 let rest = rest
3300 .strip_suffix(';')
3301 .ok_or_else(|| anyhow!("text update line is missing semicolon: {line}"))?;
3302 let (value, lookup) = rest
3303 .split_once("' WHERE a=")
3304 .ok_or_else(|| anyhow!("text update line has unexpected shape: {line}"))?;
3305 updates.push((lookup.parse()?, value.to_owned()));
3306 if updates.len() == limit {
3307 break;
3308 }
3309 }
3310 ensure!(
3311 updates.len() == limit,
3312 "benchmark10 only contained {} update rows; requested {limit}",
3313 updates.len()
3314 );
3315 Ok(updates)
3316}
3317
3318struct NativePostgres {
3319 child: Child,

Callers 1

perf_prepared_updatesFunction · 0.85

Calls 4

pushMethod · 0.80
lenMethod · 0.80
parseMethod · 0.45

Tested by

no test coverage detected