Skip to content

Function: crdtIncrement()

crdtIncrement(clientID, delta, current?): CrdtCounterMap

Defined in: core/src/schema/crdt.ts:50

Produce the next counter map after a client’s local increment. Callers pass the current map they read out of the row (or undefined for fresh rows) and receive an updated map to write back. Merging happens server-side; this helper only bumps the caller’s own slot.

delta must be non-negative — G-Counter is grow-only. Use pnIncrement / pnDecrement on a PN-counter column for signed updates (Alpha dogfood #8 called out the grow-only constraint as a blocker for “current completed tasks” that swings both ways).

string

number

Readonly<Record<string, number>> | null

CrdtCounterMap