Skip to content

Conversation

@dong-jun-shin
Copy link
Contributor

@dong-jun-shin dong-jun-shin commented Nov 27, 2025

Description

Fixes #6319

This PR adds support for the defaultSafeIntegers option in the better-sqlite3 dialect. Previously, this option was passed in the connection configuration but was not being applied to the better-sqlite3 database instance.

This change allows users to enable defaultSafeIntegers: true to receive BigInt values for integers, preventing precision loss for large numbers.

Changes

  • Modified acquireRawConnection in lib/dialects/better-sqlite3/index.js to check for defaultSafeIntegers in connection settings or options and apply it to the database instance using db.defaultSafeIntegers().

Related Issue

Checklist

  • Added integration tests
  • Updated documentation (if applicable)

@coveralls
Copy link

coveralls commented Dec 11, 2025

Coverage Status

coverage: 93.076%. remained the same
when pulling db68056 on dong-jun-shin:feat/better-sqlite3-default-safe-integers
into c92bbb3 on knex:master.

@kibertoad kibertoad merged commit f653543 into knex:master Dec 23, 2025
44 checks passed
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

5 participants