Releases: WiseLibs/better-sqlite3
Releases · WiseLibs/better-sqlite3
v7.0.0
Breaking changes
- Dropped support for Node.js versions < 10
- Replaced the
Integer
library with nativeBigInts
- Removed the
db.checkpoint()
method in favor ofdb.pragma('wal_checkpoint(RESTART)')
- Removed the "memory" option when opening databases in favor of SQLite3's
":memory:"
filename convention
Non-breaking changes
- Added support for worker threads (see an example here)
- Added support for Jest environments
- Fixed many issues related to users building packaged executables, including:
FATAL ERROR: v8::ToLocalChecked Empty MaybeLocal
FATAL ERROR: v8::Object::GetAlignedPointerFromInternalField()
Error: Cannot find module '...\node_modules\integer\node
- Various electron-related issues
- Added an optional second parameter to
db.loadExtension()
which allows users to specify the entry point of the extension - Improved documentation for building custom configurations
- Documented some undocumented features.
- Enabled SQLITE_ENABLE_GEOPOLY
- Enabled SQLITE_THREADSAFE=2
- Enabled SQLITE_OMIT_SHARED_CACHE
- Removed SQLITE_USE_URI
- The "verbose" option now logs SQL passed to db.exec() in statement-by-statement fashion, rather than all at once (to match the behavior of using prepared statements)
- Added "unsafe mode" which allows advanced users to do dangerous things at their own risk:
- allows users to mutate the database while iterating through a query, which has non-deterministic behavior
- disables
SQLITE_DBCONFIG_DEFENSIVE
which allows users to corrupt their database file and execute undefined behavior
v6.0.1
6.0.1
v6.0.0
Breaking changes
- Enabled
SQLITE_LIKE_DOESNT_MATCH_BLOBS
. - Enabled
SQLITE_DQS=0
.
Non-breaking changes
- Updated SQLite to version 3.31.1.
- Fixed many installation bugs.
- Added support for prebuilt binaries.
- Prebuilt binaries are available for this version, and will be available for all subsequent versions. The binaries are built by
prebuild
whenever a new release tag is made in github, via a travis CI workflow. As you can see in the travis config file,prebuild
currently builds binaries for Node 8, 10, and 12, and Electron 2, 3, 4, 5, 6, and 7. Non-LTS node versions are not supported, but compilingbetter-sqlite3
from source should still work fine for those versions, as it always had. Prebuilt binaries are only made for Linux and Mac OSX, not Windows (but again, building from source should work fine on Windows too).
- Prebuilt binaries are available for this version, and will be available for all subsequent versions. The binaries are built by
v5.4.0
- Added support for online backups via the db.backup() method.
- Added verbose mode, which allows you to log all SQL executed by a database connection.
- You can now execute read-only SQL while retrieving data via stmt.iterate().
- Previously, you would get a "database connection is busy" error.
- This allows you to perform nested calls to stmt.iterate().
- Removed the
SQLITE_OMIT_TRACE
compilation option. - Enabled the
SQLITE_TRACE_SIZE_LIMIT=32
compilation option.
v5.2.0
- Updated SQLite to version 3.26.0.
- Added the
Statement#raw()
andStatement#columns()
methods. - Enabled
SQLITE_DBCONFIG_DEFENSIVE
.
v5.0.0
This major version provides powerful new features, bug fixes, improved performance, and much much more.
Breaking changes
- Dropped support for Node.js versions < 8.
- Renamed
info.lastInsertROWID
toinfo.lastInsertRowid
(docs). - Renamed
stmt.returnsData
tostmt.reader
(docs). - The
db.pragma()
method now accepts{ simple: true }
instead of atrue
boolean (docs). - Redesigned the
db.transaction()
method:- Transaction objects have been removed.
- The
db.transaction()
method now takes a function and returns a function (a wrapper). - The returned function will automatically run inside a transaction.
- Nested transactions (savepoints) are supported.
- Read the full documentation here.
- Removed the
db.register()
method, added thedb.function()
anddb.aggregate()
methods:- The
db.function()
method is used to register regular user-defined functions. - The
db.aggregate()
method is used to register user-defined aggregate functions. - The APIs for both methods have been changed from the old
db.register()
method. Read the new documentation here and here, respectively. - The
db.aggregate()
method can also register window functions.
- The
- Enabled the
SQLITE_ENABLE_FTS3_PARENTHESIS
compilation option (more info). - When opening a database, the
memory
andreadonly
options are now mutually exclusive (docs). - Moved all documentation from the wiki to the repository itself (here).
- Documentation for the (deprecated) version v4.x.x can be found here.
Non-breaking new features
- SQLite3 was upgraded to version 3.25.2.
- Enabled the following compilation options:
- Users can now compile
better-sqlite3
against their own customized version of SQLite3: - If the process exits gracefully (i.e., the event loop has no more work to do), all open databases will automatically be closed. This does not happen for forced exits (i.e.,
process.exit()
,SIGINT
, etc.). - Added the
timeout
option when opening a database (docs). - Added support for anonymous in-memory databases, using the
":memory:"
filename (more info). - Added the
stmt.expand()
method, which namespaces result columns by table name (docs).
Bug fixes and other minor improvements
- Fixed a bug that caused
v8::ToLocalChecked Empty
. - Fixed a bug that caused
db.inTransaction
to betrue
when the database was closed. - Fixed a bug that prevented users from including trailing whitespace in prepared statements.
- Fixed many v8 deprecation warnings.
- Fixed many installation-related bugs.
- Improved performance of user-defined aggregate functions by ~15%.
- Added many other (minor) performance optimizations.
v4.2.0
v4.1.2
v4.1.1
A bug was fixed that was making it difficult for many Windows users to install the package.
v4.0.1
- Replaced the
Statement#each()
method with the new (and much more powerful)Statement#iterate()
method. - Support for Node.js versions below 6.0.0 have been dropped.