API reference › @evolu/common › local‑first/Protocol › decodeSqliteValue

function decodeSqliteValue(
  buffer: Buffer,
):
  | string
  | Uint8Array<ArrayBufferLike>
  | (number & Brand<"NonNaN"> & Brand<"Finite">)
  | null;

Defined in: packages/common/src/local-first/Protocol.ts:2867

Reads a SqliteValue that encodeSqliteValue wrote. It throws on input it cannot read, such as an unknown type code or truncated bytes, so a caller decoding untrusted bytes catches it, as decryptAndDecodeDbChange does. Invalid UTF-8 in a string reads as U+FFFD.