API reference › @evolu/common › Sqlite › SqliteValue

type SqliteValue =
  | string
  | Uint8Array<ArrayBufferLike>
  | (number & Brand<"NonNaN"> & Brand<"Finite">)
  | null;

Defined in: packages/common/src/Sqlite.ts:196

A value that can be stored in Sqlite.

Numeric values use FiniteNumber because JavaScript numbers also include NaN and infinities. SQLite binds NaN as NULL, while JSON serialization converts all non-finite numbers to null. Restricting numbers to finite values preserves them across storage and query serialization.

SQLite INTEGERs beyond 2^53, which only SQL itself can produce, read as the nearest number: every Evolu driver reads INTEGER as a number, and an exact Int64 would need a bigint in SqliteValue and in every driver at once.