API Reference / @evolu/common / Type / Int64

Variable: Int64

const Int64: BrandType<Type<"BigInt", bigint, bigint, BigIntError, bigint, BigIntError>, "Int64", Int64Error, BigIntError>;

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

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

Was this page helpful?