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
{{ message }}
Repository navigation
Commit a23a18b
Browse filesBrowse the repository at this point in the historyBrowse files
A JavaScript number is always bound with sqlite3_bind_double(), so it is
written as REAL even when it has no fractional part. A BigInt is bound
with sqlite3_bind_int64() and is the way to write an INTEGER. The type
conversion table listed number under both INTEGER and REAL without
saying which applies when, so the rule had to be discovered by
experiment.
Column type affinity hides this most of the time, which is why the cases
it does not cover are surprising. Comparing against a TEXT column is the
worst of them: the number 3 compares as '3.0' and silently fails to
match a stored '3', with no error to point at the cause. Document the
rule, the reason for it, and that case, and remove number from the
table's INTEGER row. Point the virtual table section's link at the new
text.
better-sqlite3 binds numbers the same way and has fielded the same
question repeatedly (WiseLibs/better-sqlite3#165, #627, #897, #1144,
#1313), each time closed as working as intended.
Fixes: #63826
Refs: WiseLibs/better-sqlite3#627
Assisted-by: Claude Opus 5.5
Signed-off-by: Trevor Burnham <trevorburnham@gmail.com>
PR-URL: #67424
Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com>
Reviewed-By: Guilherme Araújo <arauujogui@gmail.com>
0 commit comments