Skip to content

Releases: WiseLibs/better-sqlite3

v7.0.0

25 Apr 15:33
Compare
Choose a tag to compare

Breaking changes

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

24 Feb 14:12
Compare
Choose a tag to compare
6.0.1

v6.0.0

24 Feb 05:15
Compare
Choose a tag to compare

Breaking changes

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 compiling better-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).

v5.4.0

22 Jan 19:27
Compare
Choose a tag to compare
  • 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

15 Dec 13:50
Compare
Choose a tag to compare

v5.0.0

09 Oct 16:35
Compare
Choose a tag to compare

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 to info.lastInsertRowid (docs).
  • Renamed stmt.returnsData to stmt.reader (docs).
  • The db.pragma() method now accepts { simple: true } instead of a true 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 the db.function() and db.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.
  • Enabled the SQLITE_ENABLE_FTS3_PARENTHESIS compilation option (more info).
  • When opening a database, the memory and readonly 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:
    • Read the instructions here.
    • This also enables support for sqleet, SQLCipher, and other drop-in replacements for 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 be true 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

09 Oct 15:36
Compare
Choose a tag to compare

This is (probably) the last release of v4.x.x. Any documentation needed for this version can be found here. If possible, users should upgrade to version 5.0.0.

v4.1.2

13 Jun 05:08
Compare
Choose a tag to compare
  • The build system was completely overhauled, hopefully fixing many installation bugs
  • SQLite was upgraded to version 3.24.0

v4.1.1

23 May 23:25
Compare
Choose a tag to compare

A bug was fixed that was making it difficult for many Windows users to install the package.

v4.0.1

29 Aug 12:50
Compare
Choose a tag to compare
  • 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.