()
| 114 | |
| 115 | #[tokio::test] |
| 116 | async fn copy_autodetect_ndjson_extension() { |
| 117 | let srv = TestServer::start().await; |
| 118 | |
| 119 | srv.exec("CREATE COLLECTION copy_ext_test (id INT, name TEXT)") |
| 120 | .await |
| 121 | .expect("CREATE COLLECTION"); |
| 122 | |
| 123 | let ndjson = "{\"id\": 1, \"name\": \"alice\"}\n{\"id\": 2, \"name\": \"bob\"}\n"; |
| 124 | let f = write_temp(ndjson, ".ndjson"); |
| 125 | let path = f.path().to_string_lossy().to_string(); |
| 126 | // Path ends in .ndjson — no WITH clause needed. |
| 127 | srv.exec(&format!("COPY copy_ext_test FROM '{path}'")) |
| 128 | .await |
| 129 | .expect("COPY with .ndjson extension"); |
| 130 | |
| 131 | assert_eq!(count_rows(&srv, "copy_ext_test").await, 2); |
| 132 | } |
| 133 | |
| 134 | // ── test 5: explicit FORMAT csv with non-default delimiter ────────────────── |
| 135 |
nothing calls this directly
no test coverage detected