Skip to content

Releases: DallasHoff/sqlocal

0.12.0

24 Oct 03:35
Compare
Choose a tag to compare
  • Add deleteDatabaseFile method
  • Add optional callback to the overwriteDatabaseFile method which is called after the overwrite but before connections from other SQLocal client instances are allowed to access the new database. The new deleteDatabaseFile method has a similar callback.
  • Add onConnect hook that runs when the SQLocal instance initializes for the first time and anytime overwriteDatabaseFile or deleteDatabaseFile is called on the database connected to that instance.

0.11.4

19 Oct 03:49
Compare
Choose a tag to compare
  • ReadableStream<Uint8Array> has been added to the accepted input types of overwriteDatabaseFile, allowing the database file to be streamed into the OPFS in chunks. Also, if overwriteDatabaseFile is passed a File or Blob, it now streams those using ReadableStream as well.
  • Removed nanoid dependency (Contributed by @filipe-freire)

0.11.3

16 Sep 02:50
Compare
Choose a tag to compare
  • Fix deadlock that could happen when a transaction is started while a different transaction is in progress

0.11.2

14 Sep 02:54
Compare
Choose a tag to compare
  • If SQLocal is initialized in a server-side environment, it no longer throws an error. This helps simplify code structure in server-side rendered apps. Of course, queries must still be made in browser-only code paths. (Contributed by @donpark)
  • getDatabaseFile now uses SQLite's VACUUM command to return a snapshot of the database file, which can also reduce the returned file's size by cleaning up unused space and defragmenting the database.
  • Mark the package as "side-effect free" to improve tree-shaking performed by bundlers.

0.11.1

31 Jul 16:32
Compare
Choose a tag to compare
  • Fix database returning stale data after calling overwriteDatabaseFile on it
  • Fix build error when drizzle-orm is not installed

0.11.0

28 Jul 22:11
Compare
Choose a tag to compare
  • The transaction method has been reworked with a new implementation. Its new API allows running arbitrary logic between the SQL queries executed as part of a transaction while still ensuring that the transaction is atomic and isolated.
  • The SQLocalKysely dialect has been modified so that Kysely's transaction method uses SQLocal's new transaction functionality, which allows it to ensure isolation of transactions run using it.
  • A warning has been added to the SQLocalDrizzle driver that is logged when using Drizzle's transaction method since that method cannot ensure the transaction's isolation. It recommends using SQLocal's transaction method instead, as documented here.
  • The previous implementation of the transaction method is now named batch.

0.10.2

21 Jul 02:44
Compare
Choose a tag to compare
  • The SQLocal constructor can now accept an object with additional options to define the behavior of the client. For now, this includes 2 new options: readOnly and verbose
  • The sql method can now be called with a plain string if needed (e.g. sql('SELECT * FROM foo')), instead of as a tagged template
  • The sql method's type parameter was changed to represent one record in the query result (extends Record<string, any>), instead of an array of results (extends Record<string, any>[]), and a matching type parameter was added to the transaction method to allow assertion of the return type of queries

0.10.1

11 Jul 02:25
Compare
Choose a tag to compare
  • The file returned by getDatabaseFile now has the MIME type application/x-sqlite3, instead of an empty MIME type
  • Fix getDatabaseFile failing for databases not stored at the root of the origin private file system

0.10.0

06 Jul 21:41
Compare
Choose a tag to compare
  • Add getDatabaseInfo method
  • The destroy method now executes PRAGMA optimize on the database before closing the connection
  • In a future update, the transaction method will be reworked, and the current version of the method will be named batch. This update adds a batch method that is an alias of transaction.

0.9.0

10 May 02:35
Compare
Choose a tag to compare