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

Function copy_csv_header_false

nodedb/tests/sql_copy_from.rs:161–183  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

159
160#[tokio::test]
161async fn copy_csv_header_false() {
162 let srv = TestServer::start().await;
163
164 // Use a schemaless collection so positional column names (col_0, col_1)
165 // are accepted without conflict with a declared schema.
166 srv.exec("CREATE COLLECTION copy_noheader_test")
167 .await
168 .expect("CREATE COLLECTION");
169
170 // Three rows, no header — columns become col_0, col_1 (positional names).
171 // Distinct first-column values ensure no key collision.
172 let csv = "alice,9.5\nbob,8.1\ncarol,7.7\n";
173 let f = write_temp(csv, ".csv");
174 let path = f.path().to_string_lossy().to_string();
175
176 srv.exec(&format!(
177 "COPY copy_noheader_test FROM '{path}' WITH (FORMAT csv, HEADER false)"
178 ))
179 .await
180 .expect("COPY CSV HEADER false");
181
182 assert_eq!(count_rows(&srv, "copy_noheader_test").await, 3);
183}
184
185// ── test 7: path with .. rejected ────────────────────────────────────────────
186

Callers

nothing calls this directly

Calls 5

write_tempFunction · 0.85
to_stringMethod · 0.80
expectMethod · 0.45
execMethod · 0.45
pathMethod · 0.45

Tested by

no test coverage detected