json-fs-query
    Preparing search index...

    Function withWriteSet

    • Run one statement's task with a write set for the configured database: its writes and deletes are collected in memory, and reads during the task see them (see pendingFile). When the task finishes, everything it changed is put in storage at once, each file written once however many times the task changed it. When it throws, nothing it changed reaches storage: a multi-row insert or update whose third row fails leaves the first two unwritten too.

      A task inside another (a public call made from inside a statement) joins the outer write set. Node only: in a browser nothing can be written, so the task just runs.

      Type Parameters

      • T

      Parameters

      • task: () => Promise<T>

      Returns Promise<T>