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

Function copy_csv_semicolon_delimiter

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

Source from the content-addressed store, hash-verified

135
136#[tokio::test]
137async fn copy_csv_semicolon_delimiter() {
138 let srv = TestServer::start().await;
139
140 srv.exec("CREATE COLLECTION copy_semi_test (id INT, name TEXT, val FLOAT)")
141 .await
142 .expect("CREATE COLLECTION");
143
144 let csv = "id;name;val\n1;alice;1.1\n2;bob;2.2\n3;carol;3.3\n";
145 // Write with an arbitrary suffix — format will be given explicitly.
146 let f = write_temp(csv, ".txt");
147 let path = f.path().to_string_lossy().to_string();
148
149 srv.exec(&format!(
150 "COPY copy_semi_test FROM '{path}' WITH (FORMAT csv, DELIMITER ';')"
151 ))
152 .await
153 .expect("COPY CSV DELIMITER ;");
154
155 assert_eq!(count_rows(&srv, "copy_semi_test").await, 3);
156}
157
158// ── test 6: HEADER false (positional columns) ────────────────────────────────
159

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