npm better-sqlite3 5.0.0

latest releases: 10.0.0, 9.6.0, 9.5.0...
5 years ago

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.

Don't miss a new better-sqlite3 release

NewReleases is sending notifications on new releases.