API reference › @evolu/common › local‑first/Storage › readOwnerUsageOrDefault

function readOwnerUsageOrDefault(deps: SqliteDep): (
  ownerIdBytes: Uint8Array<ArrayBufferLike> &
    Brand<"Length16"> &
    Brand<"IdBytes"> &
    Brand<"OwnerIdBytes">,
  initialTimestamp: Uint8Array<ArrayBufferLike> &
    Brand<"Length16"> &
    Brand<"TimestampBytes">,
) => {
  firstTimestamp: Uint8Array<ArrayBufferLike> &
    Brand<"Length16"> &
    Brand<"TimestampBytes">;
  lastTimestamp: Uint8Array<ArrayBufferLike> &
    Brand<"Length16"> &
    Brand<"TimestampBytes">;
  storedBytes:
    | (number &
        Brand<"NonNaN"> &
        Brand<"Finite"> &
        Brand<"Int"> &
        Brand<"NonNegative">)
    | null;
};

Defined in: packages/common/src/local-first/Storage.ts:976

Reads an owner's usage from SQLite. An owner without usage has null storedBytes and initialTimestamp as its first and last timestamps.