()
| 40 | |
| 41 | #[tokio::test] |
| 42 | async fn copy_ndjson_roundtrip() { |
| 43 | let srv = TestServer::start().await; |
| 44 | |
| 45 | srv.exec("CREATE COLLECTION copy_ndjson_test (id INT, name TEXT, score FLOAT)") |
| 46 | .await |
| 47 | .expect("CREATE COLLECTION"); |
| 48 | |
| 49 | let ndjson = r#"{"id": 1, "name": "alice", "score": 9.5} |
| 50 | {"id": 2, "name": "bob", "score": 8.1} |
| 51 | {"id": 3, "name": "carol", "score": 7.7} |
| 52 | {"id": 4, "name": "dave", "score": 6.2} |
| 53 | {"id": 5, "name": "eve", "score": 5.0} |
| 54 | "#; |
| 55 | let f = write_temp(ndjson, ".ndjson"); |
| 56 | let path = f.path().to_string_lossy().to_string(); |
| 57 | |
| 58 | srv.exec(&format!("COPY copy_ndjson_test FROM '{path}'")) |
| 59 | .await |
| 60 | .expect("COPY NDJSON"); |
| 61 | |
| 62 | assert_eq!(count_rows(&srv, "copy_ndjson_test").await, 5); |
| 63 | } |
| 64 | |
| 65 | // ── test 2: JSON array import ──────────────────────────────────────────────── |
| 66 |
nothing calls this directly
no test coverage detected