Remote / foldkit-remote-drizzle

applyEdits

function · packages/remote-drizzle/src/index.ts:1063

function applyEdits<P = unknown>(
  binding: AnyEntityBinding,
  options?: {
    readonly revision?: string
    readonly live?: LiveHub<P, DrizzleDatabase>
  },
): (
  change: {
    readonly id: string
    readonly member: string
    readonly value: unknown
  },
  at: number,
) => Effect.Effect<void, RemoteServerError, DrizzleDatabase>

A journal's apply for foldkit-sync's editsJournal: one committed cell edit, written to its column with the sequence it committed at as the row's revision, in one statement that never moves a row back. An older edit run after a newer one (recovery runs an intent again) changes nothing; <=, not <, so a second change to one row in one operation lands too. The column is the binding's for the member, never one named by the change's text.

Here the revision is the journal's sequence. A table a journal writes this way should not also take writes that expect a counter there.