API reference@evolu/commonType › Int64

const Int64: brand("Int64", BigInt, (value) =>
  value >= -9223372036854775808n && value <= 9223372036854775807n
    ? ok(value)
    : err<Int64Error>({ type: "Int64", value }),
);

Defined in: packages/common/src/Type.ts:4065

64-bit signed integer.

Int64 represents a BigInt constrained to a 64-bit signed integer range, which is useful for platforms that do not support the bigint type, such as SQLite.

Because SQLite lacks a dedicated bigint type, it may return number or 'Int64 depending on the stored value or even a wrong value if a platform wrapper does not support it. A workaround for SQLite is to insert 'Int64 serialized as a string (SQLite will convert it to int) and manually cast the result to a string in SQL query and then to Int64 in JS.

https://www.sqlite.org/c3ref/int64.html