Metakit / @doeixd/metakit/store/check

checkStore

function · packages/metakit/src/storeCheck.ts:251

function checkStore(
  declared: StoreCapabilities,
  adapter: StoreAdapter,
  options?: {
    readonly runs?: number
  },
): Promise<StoreReport>

Probe adapter against its declared StoreCapabilities.

Opens two connections per run and races concurrent writers:

  • When isolation === 'serializable' and isolates === 'transaction', two writers read balance 10 and each subtract 5; if both succeed and leave balance 5, the second write did not see the first.
  • When parentRowLock === true, two writers lock the parent row, sum its children, and insert a child of 6 if total + 6 <= 10; if both succeed and leave total 12, writers of one parent ran concurrently.