From ee849fa74c19b2a993df27f1afb5632f949192c0 Mon Sep 17 00:00:00 2001 From: Colin McDonnell <3084745+colinhacks@users.noreply.github.com> Date: Mon, 16 Nov 2026 13:11:45 -0800 Subject: [PATCH] feat: bind BigInt parameters as 64-bit integers A BigInt was bound as its decimal text, so it was stored as TEXT and compared as text. Bind it with sqlite3_bind_int64 instead, and throw a RangeError for a BigInt outside the 64-bit range. --- README.md | 2 +- src/api.js | 35 +++++++++++++++++++++++-- src/exported_functions.json | 2 ++ test/test_big_int.js | 52 +++++++++++++++++++++++++++++++++++++ 4 files changed, 88 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index 94e3884b..72f9e8df 100644 --- a/README.md +++ b/README.md @@ -275,7 +275,7 @@ Example: ``` ### Enabling BigInt support -If you need ```BigInt``` support, it is partially supported since most browsers now supports it including Safari.Binding ```BigInt``` is still not supported, only getting ```BigInt``` from the database is supported for now. +A ```BigInt``` parameter is bound as a 64-bit INTEGER, and binding one outside the 64-bit range throws a ```RangeError```. To read INTEGER values as ```BigInt```, pass the ```useBigInt``` option: ```html