Skip to content

Conversation

@myndzi
Copy link
Collaborator

@myndzi myndzi commented Dec 14, 2025

Replaces #5482, fixes #6319

This change adds support for selecting how to treat integers (number or bigint) when using better-sqlite3. Adds code, documentation, and tests for using the knex factory's client options and query builder .options method to enable or disable numbers-as-bigints.

Further work incoming, but this is useful out of the box and isolated; some of the other work involves trickier refactoring.

Open question: should we use the property defaultSafeIntegers in the factory options? This is not a pass-through option to the driver no matter what it is named, so here I've kept it with the name safeIntegers in both places it's used.

Related: #6327

DRI:@myndzi

@coveralls
Copy link

Coverage Status

coverage: 93.076%. remained the same
when pulling 936425b on myndzi:myndzi/better-sqlite3-support-bigint-mode
into c92bbb3 on knex:master.

@dong-jun-shin
Copy link

@myndzi
I worked on #6320 in response to #6319, and it seems there’s some overlap in scope. I was curious about the reason for creating a new PR that includes this work.

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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

better-sqlite3: defaultSafeIntegers option is ignored

4 participants