Skip to content
This repository was archived by the owner on Jun 16, 2026. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
33 changes: 27 additions & 6 deletions crates/recoco-core/src/execution/row_indexer.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1138,7 +1138,11 @@ mod tests {
let calls = Arc::new(std::sync::atomic::AtomicUsize::new(0));

let result = collect_mutation_results([
counted_fut(calls.clone(), "export/target-a", Err(internal_error!("target-a failed"))),
counted_fut(
calls.clone(),
"export/target-a",
Err(internal_error!("target-a failed")),
),
counted_fut(calls.clone(), "export/target-b", Ok(())),
])
.await;
Expand All @@ -1148,7 +1152,10 @@ mod tests {
2,
"both mutations must be attempted even when the first fails"
);
assert!(result.is_err(), "overall result should be Err when a target fails");
assert!(
result.is_err(),
"overall result should be Err when a target fails"
);
}

#[tokio::test]
Expand All @@ -1158,7 +1165,11 @@ mod tests {

let result = collect_mutation_results([
counted_fut(calls.clone(), "export/target-a", Ok(())),
counted_fut(calls.clone(), "export/target-b", Err(internal_error!("target-b failed"))),
counted_fut(
calls.clone(),
"export/target-b",
Err(internal_error!("target-b failed")),
),
])
.await;

Expand All @@ -1176,8 +1187,16 @@ mod tests {
let calls = Arc::new(std::sync::atomic::AtomicUsize::new(0));

let result = collect_mutation_results([
counted_fut(calls.clone(), "export/target-a", Err(internal_error!("first error"))),
counted_fut(calls.clone(), "export/target-b", Err(internal_error!("second error"))),
counted_fut(
calls.clone(),
"export/target-a",
Err(internal_error!("first error")),
),
counted_fut(
calls.clone(),
"export/target-b",
Err(internal_error!("second error")),
),
counted_fut(calls.clone(), "export/target-c", Ok(())),
])
.await;
Expand Down Expand Up @@ -1211,7 +1230,9 @@ mod tests {
#[tokio::test]
async fn test_empty_target_list_succeeds() {
// Edge-case: no targets → should return Ok without panicking.
let result = collect_mutation_results(Vec::<futures::future::Ready<(String, Result<()>)>>::new()).await;
let result =
collect_mutation_results(Vec::<futures::future::Ready<(String, Result<()>)>>::new())
.await;
assert!(result.is_ok());
}
}
22 changes: 11 additions & 11 deletions crates/recoco-core/src/ops/targets/postgres.rs
Original file line number Diff line number Diff line change
Expand Up @@ -565,10 +565,7 @@ fn qualified_table_name(table_id: &TableId) -> String {
None => {
let table_name = &table_id.table_name;
if table_name.contains('.') {
table_name
.split('.')
.map(quote_identifier)
.join(".")
table_name.split('.').map(quote_identifier).join(".")
} else {
quote_identifier(table_name)
}
Expand Down Expand Up @@ -820,16 +817,19 @@ impl SetupChange {
TableUpsertionAction::Create { keys, values } => {
// Create schema if specified
if let Some(schema) = &table_id.schema {
let sql = format!("CREATE SCHEMA IF NOT EXISTS {}", quote_identifier(schema));
let sql =
format!("CREATE SCHEMA IF NOT EXISTS {}", quote_identifier(schema));
sqlx::query(&sql).execute(db_pool).await?;
}

let mut fields = (keys.iter().map(|(name, typ)| {
format!("{} {typ} NOT NULL", quote_identifier(name))
}))
.chain(values.iter().map(|(name, typ)| {
format!("{} {typ}", quote_identifier(name))
}));
let mut fields = (keys
.iter()
.map(|(name, typ)| format!("{} {typ} NOT NULL", quote_identifier(name))))
.chain(
values
.iter()
.map(|(name, typ)| format!("{} {typ}", quote_identifier(name))),
);
let sql = format!(
"CREATE TABLE IF NOT EXISTS {table_name} ({}, PRIMARY KEY ({}))",
fields.join(", "),
Expand Down
39 changes: 20 additions & 19 deletions crates/recoco-splitters/benches/splitting.rs
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ fn load_fixture(tier: &str, name: &str) -> String {
}

struct Fixtures {
prose: Vec<(String, String)>, // (tier, content)
prose: Vec<(String, String)>, // (tier, content)
rust: Vec<(String, String)>,
python: Vec<(String, String)>,
mixed: Vec<(String, String)>,
Expand All @@ -69,7 +69,12 @@ fn load_all_fixtures() -> Fixtures {
mixed.push((tier.to_string(), load_fixture(tier, "mixed.txt")));
}

Fixtures { prose, rust, python, mixed }
Fixtures {
prose,
rust,
python,
mixed,
}
}

// ---------------------------------------------------------------------------
Expand Down Expand Up @@ -186,23 +191,19 @@ fn bench_recursive_chunk(c: &mut Criterion) {
for &chunk_size in chunk_sizes {
let param = format!("{tier}/cs={chunk_size}");
group.throughput(Throughput::Bytes(content.len() as u64));
group.bench_with_input(
BenchmarkId::new("lang=rust", &param),
content,
|b, text| {
b.iter(|| {
chunker.split(
text,
RecursiveChunkConfig {
chunk_size,
min_chunk_size: None,
chunk_overlap: Some(chunk_size / 10),
language: Some("rust".to_string()),
},
)
});
},
);
group.bench_with_input(BenchmarkId::new("lang=rust", &param), content, |b, text| {
b.iter(|| {
chunker.split(
text,
RecursiveChunkConfig {
chunk_size,
min_chunk_size: None,
chunk_overlap: Some(chunk_size / 10),
language: Some("rust".to_string()),
},
)
});
});
}
}
group.finish();
Expand Down
Loading