Skip to content

Drift 2.19.0

Compare
Choose a tag to compare
@simolus3 simolus3 released this 11 Jul 11:40
· 321 commits to develop since this release
drift-2.19.0
2e343a5

Drift 2.19.0 expands the migrator API and adds a method to exclusively use the database without a transaction (useful for things like setting pragmas which are unsupported in transactions).

  • Add exclusively method to database classes, allowing a block to temporarily take exclusive control over a database connection without starting a transaction.
  • Add the enableMigrations parameter to WasmDatabase to control whether drift migrations are enabled on that database.
  • Add initiallyDeferred option to references() column builder for foreign key constraints.
  • Add dropColumn method to Migrator.
  • Add selectExpressions method to build select statements without a FROM clause.
  • Both transaction and exclusively will wait for the transaction or the exclusive lock to be set up before invoking their callback now.
  • In drift files: Support for sqlite 3.46.0.

This release also fixes the following bugs:

  • Fix encoding BigInt arguments in batched statements sent to web workers. Note that the fix also requires the latest drift_worker.js to be effective.
  • Fix stream queries possibly cancelling a migration if they are the first method on the database.
  • Drift files: Make columns coming from subquery expressions nullable.
  • Fix generated CREATE VIEW statements containing existing row class syntax only supposed to be used during static analysis.
  • Fix Dart views referencing the same column from different table aliases using columns with the same name.
  • Fix drift_dev schema steps generating invalid code when no migrations have been defined yet.
  • Fix generated imports for extension member references in modular mode.

While not part of the core packages in this repository, another addition is drift_hrana, which allows using drift with a libsql server - that may be useful for some Dart backends using Turso or related offerings.