Skip to content

Releases: WiseLibs/better-sqlite3

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

v2.2.0

12 Apr 18:56
Compare
Choose a tag to compare

ba97614 updated sqlite to 3.18.0
6b65dc3..1283e97 completely rewrote benchmarks
d2921ac minor performance improvement for .each()

v2.1.0

10 Apr 21:44
Compare
Choose a tag to compare

550fd8d added readonly mode via new Database(filename, {readonly: true})
404c739 improved performance of transaction objects

v2.0.0

10 Apr 21:42
Compare
Choose a tag to compare

5041cd8 updated copyright year
9588787 defaultSafeIntegers() now has the same semantics as safeIntegers()
59af62a removed event emitter from database prototype
0faf7a4 databases now open and close synchronously, instead requiring developers to use the event emitter interface

v1.4.0

10 Apr 21:39
Compare
Choose a tag to compare

852df57 added electron support

v1.3.9

10 Apr 21:38
Compare
Choose a tag to compare

4935a1e updated to sqlite3 3.15.0

v1.3.8

10 Apr 21:38
Compare
Choose a tag to compare

7dc4add Merge pull request #10 from bengotow/bengotow/ia32-support
f9969da fix support for ia32 on Windows