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. */
| 10867 | * that reader before opening a dedicated writer because atomic publication uses |
| 10868 | * a self-contained DELETE-mode database that switches back to WAL on write. */ |
| 10869 | static cbm_store_t *open_adr_store_for_write(cbm_mcp_server_t *srv, cbm_store_t *resolved, |
| 10870 | cbm_store_t **owned_rw) { |
| 10871 | if (!srv || !resolved || !owned_rw) { |
| 10872 | return NULL; |
| 10873 | } |
| 10874 | const char *resolved_db_path = cbm_store_db_path(resolved); |
| 10875 | if (!resolved_db_path) { |
| 10876 | return resolved; |
| 10877 | } |
| 10878 | char *rw_path = heap_strdup(resolved_db_path); |
| 10879 | if (!rw_path) { |
| 10880 | return NULL; |
| 10881 | } |
| 10882 | invalidate_cached_store(srv); |
| 10883 | *owned_rw = cbm_store_open_path(rw_path); |
| 10884 | free(rw_path); |
| 10885 | return *owned_rw; |
| 10886 | } |
| 10887 | |
| 10888 | static char *handle_manage_adr(cbm_mcp_server_t *srv, const char *args) { |
| 10889 | char *project = get_project_arg(args); |
no test coverage detected