Remote / foldkit-remote-server

RowRequirement

const · packages/remote-server/src/index.ts:292

const RowRequirement: Data.TaggedEnum.Constructor<
  | { readonly _tag: 'Any'; readonly of: ReadonlyArray<RowRequirement> }
  | {
      readonly _tag: 'Body'
      readonly query: AnyQuery
      readonly input: Readonly<Record<string, unknown>>
      readonly context: ExprContext
    }
  | { readonly _tag: 'All'; readonly of: ReadonlyArray<RowRequirement> }
>

Its type

type RowRequirement = Data.TaggedEnum<{
  Body: {
    readonly query: AnyQuery
    readonly input: Readonly<Record<string, unknown>>
    readonly context: ExprContext
  }
  All: {
    readonly of: ReadonlyArray<RowRequirement>
  }
  Any: {
    readonly of: ReadonlyArray<RowRequirement>
  }
}>

What the row an update or a delete finds must hold for it to land, judged in the statement that writes it: a guard's rule that reads another row (a path, an exists), against what that row holds as the statement runs.

In the guides