Drift 2.19.0
simolus3
released this
11 Jul 11:40
·
339 commits
to develop
since this release
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 toWasmDatabase
to control whether drift migrations are enabled on that database. - Add
initiallyDeferred
option toreferences()
column builder for foreign key constraints. - Add
dropColumn
method toMigrator
. - Add
selectExpressions
method to build select statements without aFROM
clause. - Both
transaction
andexclusively
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 latestdrift_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.