Skip to content

Releases: WiseLibs/better-sqlite3

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.

v3.3.0

28 Aug 03:18
Compare
Choose a tag to compare

SQLite3 extensions are now supported. See the docs to learn how to use them.

v3.2.0

24 Aug 23:12
Compare
Choose a tag to compare

The database constructor now supports the fileMustExist option.

v3.1.0

12 Jun 04:03
Compare
Choose a tag to compare

Added the db.inTransaction getter, allowing you to check if the database connection is currently in an open transaction.

v3.0.3

08 Jun 16:44
Compare
Choose a tag to compare

The bundled sqlite3 engine has been upgraded to version 3.19.3.

v3.0.0

06 Jun 04:57
Compare
Choose a tag to compare

This major version provides some powerful new features, introduces a better API for some functions, and comes with many small performance enhancements.

Breaking changes

  • readonly mode has been reimplemented to use sqlite's engine-level readonly mode, instead of being implemented at the library level.
  • Database#pragma() has been reworked to return proper result types (instead of just strings), and now works properly with readonly mode.
  • Database#checkpoint() has been completely reworked. It now accepts different arguments and has a different return value. By default, it now checkpoints all attached databases instead of just the main database. To learn how to use it, click here.
  • The Database.Int64 class has been replaced by Database.Integer which is a reference to the self-contained integer package. Database.Integer has a very different API from the old Database.Int64, and provides many powerful features and utilities. Read about it here.
  • All boolean options (like new Database(options.readonly) or statement.pluck(newState)) must be boolean if provided. Previously, they used the truthiness of whatever was provided, but now the provided value must either be true, false, or omitted. An error will be thrown if a non-boolean value is provided.

Non-breaking new features

  • The bundled sqlite3 engine has been upgraded to version 3.19.2.
  • When an sqlite3-related error is thrown, it will be an SqliteError, which is a subclass of Error, and has a code property that corresponds to a result code.
    • This allows you to do checks like if (err.code === 'SQLITE_CONSTRAINT_UNIQUE')
    • The SqliteError class is available at Database.SqliteError
  • Database#register() now accepts generator functions, which registers a custom aggregate SQL function. To learn how to use them, read here.

Bug fixes and other minor improvements

  • The nan package dependency has been removed, slightly improving performance.
  • When more than 4294967295 rows are returned by Statement#all(), an error is thrown instead of corrupting the results returned from the database (this is the maximum array.length in nodejs).
  • You can now use a combination of multiple prefixes ($foo, :foo, @foo) when creating a statement or transaction with named parameters. Previously this would result in errors being thrown.
  • The Statement#bind() and Transaction#bind() methods can now be used even if the query was previously executed.
  • The performance of binding named parameters has been significantly improved.
  • Many other minor performance enhancements.

Expected issues

The installation process has been completely rewritten, so I expect there to be installation issues when using Windows and/or Electron. If an issue like this comes up, please open an issue and I'll fix it as soon as possible.

v2.3.3

30 Apr 04:52
Compare
Choose a tag to compare

fa3624e..0985983 improved performance of binding named parameters
0215d67, 03713e2 improved error messages when binding parameters
77ea5b1, f700521, d898405, 1d4c786 improved general performance

v2.3.1

14 Apr 20:57
Compare
Choose a tag to compare

85612bf Minor performance optimization for Statement#each()
c7b5d38 Significant performance optimization for Statement#all()

v2.3.0

13 Apr 06:01
Compare
Choose a tag to compare

This release fixes a few minor bugs, significantly improves overall performance, and introduces the db.register() method, which allows you to define custom SQL functions.

0d4e336 added the db.register() method, allowing you to register custom SQL functions
f3daddb prepared statements and transactions can now be reused even after the table schema changes
6fff040 pluck() and safeIntegers() can no longer be invoked within an each() callback function