| 3143 | /* ── Node batch ─────────────────────────────────────────────────── */ |
| 3144 | |
| 3145 | int cbm_store_upsert_node_batch(cbm_store_t *s, const cbm_node_t *nodes, int count, |
| 3146 | int64_t *out_ids) { |
| 3147 | if (count == 0) { |
| 3148 | return CBM_STORE_OK; |
| 3149 | } |
| 3150 | |
| 3151 | exec_sql(s, "BEGIN IMMEDIATE;"); |
| 3152 | for (int i = 0; i < count; i++) { |
| 3153 | int64_t id = cbm_store_upsert_node(s, &nodes[i]); |
| 3154 | if (id == CBM_STORE_ERR) { |
| 3155 | exec_sql(s, "ROLLBACK;"); |
| 3156 | return CBM_STORE_ERR; |
| 3157 | } |
| 3158 | if (out_ids) { |
| 3159 | out_ids[i] = id; |
| 3160 | } |
| 3161 | } |
| 3162 | exec_sql(s, "COMMIT;"); |
| 3163 | return CBM_STORE_OK; |
| 3164 | } |
| 3165 | |
| 3166 | /* ── Edge CRUD ──────────────────────────────────────────────────── */ |
| 3167 |
no test coverage detected