resolve_store opens file-backed projects query-only. A mutation must release * that reader before opening a dedicated writer because atomic publication uses * a self-contained DELETE-mode database that switches back to WAL on write. */
| 11111 | * that reader before opening a dedicated writer because atomic publication uses |
| 11112 | * a self-contained DELETE-mode database that switches back to WAL on write. */ |
| 11113 | static cbm_store_t *open_adr_store_for_write(cbm_mcp_server_t *srv, cbm_store_t *resolved, |
| 11114 | cbm_store_t **owned_rw) { |
| 11115 | if (!srv || !resolved || !owned_rw) { |
| 11116 | return NULL; |
| 11117 | } |
| 11118 | const char *resolved_db_path = cbm_store_db_path(resolved); |
| 11119 | if (!resolved_db_path) { |
| 11120 | return resolved; |
| 11121 | } |
| 11122 | char *rw_path = heap_strdup(resolved_db_path); |
| 11123 | if (!rw_path) { |
| 11124 | return NULL; |
| 11125 | } |
| 11126 | invalidate_cached_store(srv); |
| 11127 | *owned_rw = cbm_store_open_path(rw_path); |
| 11128 | free(rw_path); |
| 11129 | return *owned_rw; |
| 11130 | } |
| 11131 | |
| 11132 | static char *handle_manage_adr(cbm_mcp_server_t *srv, const char *args) { |
| 11133 | char *project = get_project_arg(args); |
no test coverage detected