| 2285 | } |
| 2286 | |
| 2287 | int cbm_write_db(const char *path, const char *project, const char *root_path, |
| 2288 | const char *indexed_at, CBMDumpNode *nodes, int node_count, CBMDumpEdge *edges, |
| 2289 | int edge_count, CBMDumpVector *vectors, int vector_count, |
| 2290 | CBMDumpTokenVec *token_vecs, int token_vec_count) { |
| 2291 | /* One-shot = open + append all nodes in a single batch + finalize. |
| 2292 | * Produces byte-identical output to the former monolithic writer. */ |
| 2293 | cbm_db_writer_t *w = cbm_writer_open(path); |
| 2294 | if (!w) { |
| 2295 | return CBM_NOT_FOUND; |
| 2296 | } |
| 2297 | (void)cbm_writer_append_nodes(w, nodes, |
| 2298 | node_count); /* error recorded in w, handled by finalize */ |
| 2299 | return cbm_writer_finalize(w, project, root_path, indexed_at, nodes, node_count, edges, |
| 2300 | edge_count, vectors, vector_count, token_vecs, token_vec_count); |
| 2301 | } |
no test coverage detected