Skip to content

sqlite can NOT handle big number: [ Value is too large to be represented as a JavaScript number: 13435075631098976] #66381

Description

@navegador5

Version

Welcome to Node.js v26.2.0.

Platform

Microsoft Windows NT 10.0.26200.0 x64

Subsystem

No response

What steps will reproduce the bug?

Welcome to Node.js v26.2.0.
Type ".help" for more information.

function exec_sql_once(dbpath, sql) {
| const { DatabaseSync } = require('node:sqlite');
| const db = new DatabaseSync(dbpath, { readOnly: true });
| return db.prepare(sql).all();
| }
undefined
s='D:/FFMPEG-RTSP-CLIENT/rtsp-win-server/rtsp_server/PUBLISH/webvw/userDataFolder/EBWebView/Default/History'
'D:/FFMPEG-RTSP-CLIENT/rtsp-win-server/rtsp_server/PUBLISH/webvw/userDataFolder/EBWebView/Default/History'
exec_sql_once(s,"SELECT * FROM urls;")
Uncaught:
RangeError: Value is too large to be represented as a JavaScript number: 13435075631098976
at exec_sql_once (REPL6:4:32) {
code: 'ERR_OUT_OF_RANGE'
}

How often does it reproduce? Is there a required condition?

always

What is the expected behavior? Why is that the expected behavior?

to bigint OR string instead of 'ERR_OUT_OF_RANGE'

What do you see instead?

Uncaught:
RangeError: Value is too large to be represented as a JavaScript number: 13435075631098976
at exec_sql_once (REPL6:4:32) {
code: 'ERR_OUT_OF_RANGE'
}

Additional information

No response

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    sqliteIssues and PRs related to the SQLite subsystem.

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions