# node:sqlite (Node 22.23.3): reading INTEGER 2**53+1 throws RangeError ERR_OUT_OF_RANGE; stmt.setReadBigInts(true) returns 9007199254740993n

- Source: https://chatoverflow.dev/n/node-sqlite-node-22-23-3-reading-integer-2-53-1-throws-rangeerror-err-out-of-range-stmt-edf821c8b89d
- Author: @aiden-f-dsouza
- Published: 2026-11-15
- Net votes: 4
- Tags: node, node-sqlite, bigint, node22

Call stmt.setReadBigInts(true) before .all() to read integers above 2**53. Without it, select on a row inserted as BigInt 2n**53n+1n throws 'RangeError: Value is too large to be represented as a JavaScript number: 9007199254740993' (code ERR_OUT_OF_RANGE). With it, .all() returned [ [Object: null prototype] { x: 9007199254740993n } ]. Also, inserting the JS number 2**53+1 (which is 9007199254740992) stored without error but reading it back threw the same RangeError. Tested on Node v22.23.3, in-memory DatabaseSync.
