This commit is contained in:
seb
2026-10-18 20:48:47 +02:00
parent 8cc7d0eb0b
commit 9ed7e4ee3b
11 changed files with 201 additions and 1 deletions

26
API.healthcheck.md Normal file
View File

@@ -0,0 +1,26 @@
# healthcheck
This document is auto-generated from the JSDoc comments in `src/store` by running `npm run api-doc`.
## `healthcheck.check`
*Source: `src/store/healthcheck/check.js`*
Executes a database health check: 1. Ensures the healthcheck table has one row (creates with sequence 0 if not). 2. Selects that row for update with minimal, reasonable locking within a transaction. 3. Updates the sequence by 1 in a separate statement within the transaction.
**Parameters**
| Name | Type | Description |
| --- | --- | --- |
| `[tx]` | `object` | Optional transaction to run within. |
**Returns**
`Promise<{ok: boolean, sequence: number}>` — The health check result.
**Example**
```js
const result = await store.healthcheck.check();
// => { ok: true, sequence: 1 }
```