You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When trying to fetch data from Turso DB where one table column has long integer (for me integer with 19 digit ). It is giving error cannot be safely represented as a JavaScript number
Full trace :
RangeError: Received integer 1658936802800002836 which cannot be safely represented as a JavaScript number
at valueFromProto (/home/user/project/node_modules/@libsql/hrana-client/lib-esm/value.js:46:19)
at rowFromProto (/home/user/project/node_modules/@libsql/hrana-client/lib-esm/result.js:37:23)
at /home/user/project/node_modules/@libsql/hrana-client/lib-esm/result.js:13:44
at Array.map (<anonymous>)
at rowsResultFromProto (/home/user/project/node_modules/@libsql/hrana-client/lib-esm/result.js:13:33)
at Object.responseCallback (/home/user/project/node_modules/@libsql/hrana-client/lib-esm/stream.js:41:30)
at Client.#handleMsg (/home/user/project/node_modules/@libsql/hrana-client/lib-esm/client.js:213:31)
at Client.#onSocketMessage (/home/user/project/node_modules/@libsql/hrana-client/lib-esm/client.js:178:18)
at /home/user/project/node_modules/@libsql/hrana-client/lib-esm/client.js:53:66
at /home/user/project/node_modules/@miniflare/shared/src/event.ts:29:9
TypeError: WebSocket already closed
at _WebSocket.[kClose] (/home/user/project/node_modules/@miniflare/web-sockets/src/websocket.ts:298:38)
at _WebSocket.close (/home/user/project/node_modules/@miniflare/web-sockets/src/websocket.ts:291:10)
at Client.#setClosed (/home/user/project/node_modules/@libsql/hrana-client/lib-esm/client.js:165:22)
at Client.#onSocketMessage (/home/user/project/node_modules/@libsql/hrana-client/lib-esm/client.js:182:18)
at /home/user/project/node_modules/@libsql/hrana-client/lib-esm/client.js:53:66
at /home/user/project/node_modules/@miniflare/shared/src/event.ts:29:9
at /home/user/project/node_modules/@miniflare/web-sockets/src/websocket.ts:189:38
at AsyncLocalStorage.run (node:async_hooks:330:14)
The text was updated successfully, but these errors were encountered:
Basically, this is expected default behavior: we chose to convert SQLite integers to JavaScript numbers by default, but we don't yet provide a way to opt into using bigints instead.
What would be your preferred solution? Would you prefer if we returned integers as bigints by default?
Fixed in version 0.4.2, you can use Client.intMode or Stream.intMode to choose the JavaScript representation of SQLite integers: either number, bigint or string.
When trying to fetch data from Turso DB where one table column has long integer (for me integer with 19 digit ). It is giving error cannot be safely represented as a JavaScript number
Full trace :
The text was updated successfully, but these errors were encountered: