MCPcopy Create free account
hub / github.com/NodeDB-Lab/nodedb / copy_to_csv_no_header

Function copy_to_csv_no_header

nodedb/tests/sql_copy_to.rs:134–150  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

132
133#[tokio::test]
134async fn copy_to_csv_no_header() {
135 let srv = TestServer::start().await;
136
137 seed_collection(&srv, "copy_to_csv_nohdr").await;
138
139 let (_dir, out_path) = temp_output_path(".csv");
140 srv.exec(&format!(
141 "COPY copy_to_csv_nohdr TO '{out_path}' WITH (FORMAT csv, HEADER false)"
142 ))
143 .await
144 .expect("COPY TO CSV without header");
145
146 let content = std::fs::read_to_string(&out_path).expect("read output file");
147 let lines: Vec<&str> = content.lines().collect();
148 // No header: should have exactly 3 rows.
149 assert_eq!(lines.len(), 3, "expected 3 data rows, no header");
150}
151
152// ── test 5: COPY (SELECT ...) TO query-form ──────────────────────────────────
153

Callers

nothing calls this directly

Calls 5

seed_collectionFunction · 0.85
temp_output_pathFunction · 0.85
collectMethod · 0.80
expectMethod · 0.45
execMethod · 0.45

Tested by

no test coverage detected