PackageTrack
Sign in Get early access

drift

Drift is a reactive library to store relational data in Dart and Flutter applications.

2.34.3 1.1M downloads/mo #327 most downloaded on pub.dev simolus3/drift

What this package is like to depend on

Last release 27 days ago

27 Jul 2026

Ships on a steady schedule

a new release about every 4 weeks

Nearly every release is documented

notes for 71 of 75 stable releases

Nothing withdrawn

no release was ever pulled

5 years old

75 releases · first in 2021

12 releases in the last 12 months

see the full history below

Release timeline

75 releases · Oct 2021 to Jul 2026
2022 2023 2024 2025 2026
Release Pre-release

Releases

latest 60 of 75
  1. 2.34.3 27 Jul 2026
    Release notes
    • Web: Use navigator locks around OPFS access to avoid file locking issues.
    Open source →
    Release notes
    • Web: Use navigator locks around OPFS access to avoid file locking issues.
    Open source →
  2. 2.34.2 14 Jul 2026
    Release notes
    • Web: Flush IndexedDB writes after statements, making writes more reliable.

    sqlite3.wasm files are now attached to drift releases directly, making it easier to download compatible workers and WebAssembly files.

    Open source →
    Release notes
    • Web: Flush IndexedDB writes after statements, making writes more reliable.
    Open source →
  3. 2.34.1 06 Jul 2026
    Release notes

    drift 2.34.1

    • Fix reads queued in a MultiExecutor connection pool being resumed in the wrong zone once an executor became available. Because Drift's cancellation tokens are zone-scoped, this could cause queries to be cancelled or observed in the wrong zone (#3824).

    drift_dev 2.34.2

    • Drift files: Support for dart placeholder in update statements to reference companions.
    • Allow circular references between tables (#3780).

    sqlparser 0.44.6

    • Fix join analysis to properly treat the left side of a RIGHT or FULL join as nullable (#3812).
    • Fix CaseInsensitiveMap.containsKey to be case-insensitive.
    Open source →
    Release notes
    • Fix reads queued in a MultiExecutor connection pool being resumed in the wrong zone once an executor became available. Because Drift's cancellation tokens are zone-scoped, this could cause queries to be cancelled or observed in the wrong zone (#3824).
    Open source →
  4. 2.34.0 10 Jun 2026
    Release notes
    • Use BEGIN IMMEDIATE to start transactions.
    • Make TableInfo's == and hashCode take into account the database its attached to.
    Open source →
  5. 2.33.0 03 May 2026
    Release notes
    • Add length extension for blob expressions.
    • Add SqlDialect.duckdb for use with the drift_duckdb package.
    Open source →
  6. 2.32.1 22 Mar 2026
    Release notes
    • DevTools extension: Make error messages selectable.
    Open source →
  7. 2.32.0 28 Feb 2026
    Release notes
    • Potentially breaking change Migrate to version 3.x of the sqlite3 package. To upgrade:
      • For the web, update sqlite3.wasm from a 3.x release.
      • If you've previously used sqlcipher_flutter_libs, see this for encryption support and note that SQLite3MultipleCiphers requires additional pragmas to be compatible with SQLCipher databases.
    • serializableConnection(), json1 and TableMigration are no longer marked as experimental.
    • Improve performance of mapping large result sets through joined select statements.
    Open source →
  8. 2.31.0 03 Feb 2026
    Release notes
    • In step-by-step migrations, automatically throw an error if a database downgrade is attempted. This has always been unsupported, but could lead to the database silently having a wrong user_version.
    Open source →
  9. 2.30.1 12 Jan 2026
    Release notes
    • Web: Fix databases being moved from IndexedDB to OPFS even if moveExistingIndexedDbToOpfs is disabled.
    Open source →
  10. 2.30.0 05 Dec 2025
    Release notes
    • Add rightOuterJoin and fullOuterJoin.
    • Wasm: Add the WasmProbeResult.moveFromIndexedDBToOpfs() method and the moveExistingIndexedDbToOpfs parameter on WasmDatabase.open. They can be used to move an existing database stored in IndexedDB to OPFS.
    Open source →
  11. 2.29.0 18 Oct 2025
    Release notes
    • Allow specifying ordering for columns in @TableIndex annotation.
    • Add DelegatedDatabase.externalExecutor, allowing transactions started externally to be used with drift.
    • Add Batch.insertFromSelect to insert rows from a select statement in a batch.
    • Devtools extension: Support exporting databases.
    Open source →
  12. 2.28.2 21 Sep 2025
    Release notes
    • Legacy wasm database: Fix cast issue when compiling with dart2wasm.
    • NativeDatabase.createBackground: Allow enabling isolateDebugLog.
    Open source →
  13. 2.28.1 29 Jul 2025
    Release notes
    • Add escapeChar argument to like() to generate an ESCAPE clause.
    • Native database: Cache prepared statements by default.
    Open source →
  14. 2.28.0 13 Jul 2025
    Release notes
    • Query delegates: Support nested transactions in SupportedTransactionDelegate.
    • Add WasmProbeResult.exportDatabase to export an existing web database as a Uint8List.
    • Fix drift server isolates leaking when their only client isolate exits without closing the database.
    Open source →
  15. 2.27.0 14 Jun 2025
    Release notes
    • Allow passing sqlite3 callback to NativeDatabase to customize how SQLite bindings are obtained.
    Open source →
  16. 2.26.1 03 May 2025
    Release notes
    • Add isNotNull() column filter for the manager APIs.
    • Add optional orderBy parameter to more aggregate function extension.
    Open source →
  17. 2.26.0 08 Mar 2025
    Release notes
    • Add support for window functions with WindowFunctionExpression.
    Open source →
  18. 2.25.1 14 Feb 2025
    Release notes
    • Fix shared worker feature detection when the main app is compiled with dart2wasm.
    Open source →
  19. 2.25.0 08 Feb 2025
    Release notes
    • Report SqliteExceptions occurring on workers as SqliteException instances. Previously, they were sent as strings only.
    • Fix LazyDatabase being closed without ever being used potentially leaking resources.
    Open source →
  20. 2.24.0 21 Jan 2025
    Release notes
    • Add TypeConverter.jsonb to directly store values in the JSONB format used by SQLite.
    • Deprecate TypeConverter.json utility in favor of TypeConverter.json2. The new method avoids encoding values twice when mapping drift row classes to JSON.
    • Add runWithInterceptor method to databases to only apply interceptors in a restricted block.
    Open source →
  21. 2.23.1 05 Jan 2025
    Release notes
    • Fix TableStatements.insertAll to only apply a database-specific pragma for SQLite databases.
    • Don't attempt to roll-back transactions that failed to begin.
    • Fix unhandled exception when cancelling transactions.
    • Fix deadlock when drift databases are used in a fake_async Zone and then closed outside that zone.
    Open source →
  22. 2.23.0 27 Dec 2024
    Release notes
    • Allow building compound select statements in Dart.
    • Support NULLS FIRST and NULLS LAST in manager API.
    Open source →
  23. 2.22.1 30 Nov 2024
    Release notes
    • Fix generated SQL for insertFromSelect statements with upserts.
    • Fix alterTable for databases where legacy_alter_table is not writable.
    • Allow package:drift/web.dart to be imported into Dart apps compiled with dart2wasm.
    Open source →
  24. 2.22.0 28 Nov 2024
    Release notes
    • Add sqliteAny() method to tables to declare ANY columns.
    • Add missing parentheses around adjacent expressions of the same precedence.
    • Fix creating tables that are both STRICT and WITHOUT ROWID.
    • WASM: Report worker failures to make them easier to diagnose.
    • Allow closing stream queries synchronously, making drift easier to use in widget tests.
    Open source →
  25. 2.21.0 14 Oct 2024
    Release notes
    • To infer whether serialization is required for inter-isolate communication, drift now sends a test message instead serializing by default.
    • The manager API now ignores references whose target column is a foreign key itself.
    • The DevTools extension can now clear drift databases.
    • View.from is now declared to return a JoinedSelectStatement, the type it returns at runtime.
    Open source →
  26. 2.20.3 29 Sep 2024

    Nothing published for this version

  27. 2.20.2 10 Sep 2024
    Release notes
    • Fix upcoming unreachable_switch_default lint.
    Open source →
  28. 2.20.1 08 Sep 2024
    Release notes
    • Migrate legacy package:drift/web.dart to the new JS interop SDK libraries. For backwards compatibility, the channel() extension on the MessagePort class in dart:html has been kept. Once dart:html is removed from the Dart SDK, that extension will have to be removed from drift as well.
    • Fix cast errors in the protocol for remote workers when compiling with dart2wasm.
    • Introduce a faster protocol for communicating with workers. This protocol is enabled automatically after upgrading drift_worker.js.
    Open source →
  29. 2.20.0 16 Aug 2024
    Release notes
    • Improve manager API to be able to resolve references when running queries.
    • Add readPool parameter to NativeDatabase. It will spawn an additional pool of isolates used to serve multiple reads in parallel, which can improve performance in some specific workloads.
    • Add TableIndex.sql, allowing database indexes to be defined in SQL without using drift files.
    • Add DataClassName.implementing, which can be used to make drift-generated row classes implement existing interfaces.
    • Mark legacy package:drift/web.dart as deprecated. Users should migrate to package:drift/wasm.dart.
    Open source →
  30. 2.19.2 13 Aug 2024
    Release notes
    • Support version 1.x of package:web.
    Open source →
  31. 2.19.1 12 Jul 2024

    Nothing published for this version

  32. 2.19.1+1 18 Jul 2024
    Release notes
    • Fix exclusively breaking the database connection on the web. Please note that this requires an updated drift_worker.js to fix.
    Open source →
  33. 2.19.0 11 Jul 2024
    Release notes
    • 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.
    • 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.
    • Both transaction and exclusively will wait for the transaction or the exclusive lock to be set up before invoking their callback now.
    • Fix stream queries possibly cancelling a migration if they are the first method on the database.
    Open source →
  34. 2.18.0 04 May 2024
    Release notes
    • Adds a new interface for writing most simple statements without manually creating select statements and expressions. For a detailed description, see the documentation website. This feature requires additional code to be generated - if you prefer using the existing APIs exclusively, you can use the generate_manager: false builder option
    • Add AggregateFunctionExpression to write custom aggregate function invocations in the Dart query builder.
    • The json_group_array and jsonb_group_array functions now contain an orderBy and filter parameter.
    Open source →
  35. 2.17.0 20 Apr 2024
    Release notes
    • Adds companion entry to DataClassName to override the name of the generated companion class.
    • Add the TypeConverter.extensionType factory to create type converters for extension types.
    • Fix invalid SQL syntax being generated for BLOB literals on postgres.
    Open source →
  36. 2.16.0 24 Feb 2024
    Release notes
    • When a migration throws, the database will now block subsequent operations instead of potentially allowing them to operate on a database in an inconsistent state.
    • Statements built through the Dart query builder will now run in the context active while they are running, instead of the context active at the time they were created. For instance, creating an UpdateStatement with database.update outside of a transaction and then calling UpdateStatement.write inside of a transaction will now perform the update inside of the transaction, instead of causing a deadlock.
    • Improve stack traces for errors happening on drift isolates (which includes usages of NativeDatabase.createInBackground).
    • Don't cache EXPLAIN statements, avoiding schema locks.
    • Deprecate Value.ofNullable in favor of Value.absentIfNull, which is more explicit about its behavior and allows nullable types too.
    • Migrate WasmDatabase to dart:js_interop and package:web.
    Open source →
  37. 2.15.0 17 Jan 2024
    Release notes
    • Methods in the query builder API now respect custom types.
    • Support DialectAwareSqlType, custom types that depend on the dialect of the active database connection. This can be used to use native types not supported by drift (like UUIDs) on databases that support it while falling back to a text type on sqlite3.
    • Close wasm databases hosted in workers after the last client disconnects.
    • Add enableMigrations parameter to NativeDatabase which can be used to optionally disable database migrations when opening databases.
    • Support jsonb functions in the Dart query builder.
    Open source →
  38. 2.14.1 12 Dec 2023
    Release notes
    • Fix WasmProbeResult.open ignoring the ìnitializeDatabase callback.
    Open source →
  39. 2.14.0 04 Dec 2023
    Release notes
    • Add the QueryInterceptor API to easily monitor or transform all database calls made by drift.
    • Add the count() extension on tables to easily count rows in tables or views.
    Open source →
  40. 2.13.2 26 Nov 2023
    Release notes
    • Fix a race condition causing query streams to not emit new data around some transaction setups.
    Open source →
  41. 2.13.1 05 Nov 2023
    Release notes
    • Fix a bug when running batches over serialized communication channels.
    Open source →
  42. 2.13.0 20 Oct 2023
    Release notes
    • Add APIs to setup Wasm databases with custom drift workers.
    • Add support for custom types, which are useful when extending drift to support other database engines.
    • Drift now provides a DevTools extension embedding the drift inspector written by Koen Van Looveren.
    • Add Expression.and and Expression.or to create disjunctions and conjunctions of sub-predicates.
    • Step-by-step migrations now save the intermediate schema version after each step.
    Open source →
  43. 2.12.1 27 Sep 2023
    Release notes
    • Fix readWithConverter throwing an exception for null values in non- nullable columns.
    Open source →
  44. 2.12.0 24 Sep 2023
    Release notes
    • Add support for table-valued functions in the Dart query builder.
    • Add the @TableIndex annotation for table classes to add an index to the table.
    • Support json_each and json_tree.
    • Add the TypeConverter.json method to define type converters storing JSON values more easily.
    • Add TypedResult.readWithConverter to read a column with a type converter from a join result row.
    Open source →
  45. 2.11.1 27 Aug 2023
    Release notes
    • Allow using .read() for a column added to a join from the table, fixing a regression in drift 2.11.0.
    • Make step-by-step migrations easier to customize with Migrator.runMigrationSteps.
    Open source →
  46. 2.11.0 11 Aug 2023
    Release notes
    • Add support for subqueries in the Dart query builder.
    • Add isInExp and isNotInExp to construct IS IN expressions with arbitrary expressions.
    • Add the substr extension on Expression<String> to call the sqlite3 function from the Dart API.
    • Add isolateSetup to NativeDatabase.createInBackground() to override native libraries or perform other database-unrelated setup work.
    • Add WasmDatabase.probe(), a method probing for available implementations and existing databases on the web without opening one directly.
    Open source →
  47. 2.10.0 13 Jul 2023
    Release notes
    • Adds the schema steps command to drift_dev. It generates an API making it easier to write safe schema migrations (docs).
    • Fix drift WASM not being unusable after a previous database implementation becomes unavailable in the browser.
    Open source →
  48. 2.9.0 18 Jun 2023
    Release notes
    • Forbid schemaVersion returning 0, as this causes issues in the migrator.
    • Drift web support is now stable! By using a WasmDatabase.open factory as described in https://drift.simonbinder.eu/web/, you can run a drift database in modern browsers!
    Open source →
  49. 2.8.2 08 Jun 2023
    Release notes
    • Fix prepared statements leaking when the statement cache is disabled.
    • Disable prepared statement caching by default.
    Open source →
  50. 2.8.1 01 Jun 2023
    Release notes
    • Performance improvement: Cache and re-use prepared statements - thanks to @davidmartos96
    • Fix a deadlock after rolling back a transaction in a remote isolate.
    • Remove unintended log messages when using connectToDriftWorker.
    Open source →
  51. 2.8.0 10 May 2023
    Release notes
    • Don't keep databases in an unusable state if the setup callback throws an exception. Instead, drift will retry the next time the database is used.
    • Allow targeting partial indices in DoUpdate (#2394)
    • Fix deadlocks when computeWithDatabase is called inside a transaction().
    Open source →
  52. 2.7.0 10 Apr 2023
    Release notes
    • Add support for CASE expressions without a base in the Dart API with the CaseWhenExpression class.
    • Add the new package:drift/web/workers.dart library which makes it easier to create web workers for drift.
    Open source →
  53. 2.6.0 20 Mar 2023
    Release notes
    • Add insertReturningOrNull for potentially empty inserts.
    • Add insertFromSelect to InsertStatement to run INSERT INTO SELECT statements.
    • Add rowid parameter to companions for tables with rowids that don't have a visible alias for the rowid.
    • After opening a database with a higher schema version than the current one set in the database class, the schema version in the database will now be downgraded.
    • When using a drift isolate in the same engine group, errors on the remote end are reported directly instead of wrapping them in a DriftRemoteException.
    • Added support for DO NOTHING during upsert operations with constraint violations
    Open source →
  54. 2.5.0 29 Jan 2023
    Release notes
    • Add isExp, isValue, isNotExp and isNotValue methods to Expression to generate the IS operator in SQL.
    • Add all() extension on tables and views to quickly query all rows.
    • Add serializableConnection() and computeWithDatabase() as extensions on databases. The methods allow sharing any drift database between isolates, regardless of how the database has been set up.
    • The DatabaseConnection class now implements QueryExecutor, meaning that you no longer need a special .connect() constructor to use it.
    Open source →
  55. 2.4.2 03 Jan 2023
    Release notes
    • Fix an exception when a client disconnects from a drift remote server while processing a pending table update.
    Open source →
  56. 2.4.1 31 Dec 2022
    Release notes
    • Fix DriftIsolate leaking resources for closed connections.
    Open source →
  57. 2.4.0 29 Dec 2022
    Release notes
    • Add textEnum column builder and EnumNameConverter to be able to store enum values as string.
    • Add updates parameter to Batch.customStatement - it can be used to specify which tables are affected by the custom statement.
    • For STRICT tables in drift files declaring a ANY column, drift will now generate a mapping to the new DriftAny type.
    • Add likeExp to generate LIKE expression with any comparison expression.
    • Fix UNIQUE keys declared in drift files being written twice.
    • Fix customConstraints not appearing in dumped database schema files.
    • Lazily load columns in TypedResult.read, increasing performance for joins with lots of tables or columns.
    • Work-around an issue causing complex migrations via Migrator.alterTable not to work if a view referenced the altered table.
    Open source →
  58. 2.3.0 27 Nov 2022
    Release notes
    • Add the JsonTypeConverter2 mixin. It behaves similar to the existing json type converters, but can use a different SQL and JSON type.
    • Add isInValues and isNotInValues methods to columns with type converters. They can be used to compare the column against a list of Dart expressions that will be mapped through a type converter.
    • Add TableStatements.insertAll to atomically insert multiple rows.
    • Add singleClientMode to remote() and DriftIsolate connections to make the common case with one client more efficient.
    • Fix a concurrency issue around transactions.
    • Add NativeDatabase.createInBackground as a drop-in replacement for NativeDatabase. It creates a drift isolate behind the scenes, avoiding all of the boilerplate usually involved with drift isolates.
    • Experimental: Add a modular generation mode in which drift will generate multiple smaller files instead of one very large one with all tables and generated queries.
    Open source →
  59. 2.2.0 06 Oct 2022
    Release notes
    • Always escape column names, avoiding the costs of using a regular expression to check whether they need to be escaped.
    • Add extensions for binary methods on integer expressions: operator ~, bitwiseAnd and bitwiseOr.
    Open source →
  60. 2.1.0 29 Aug 2022
    Release notes
    • Improve stack traces when using watchSingle() with a stream emitting a non- singleton list at some point.
    • Add OrderingTerm.nulls to control the NULLS FIRST or NULLS LAST clause in Dart.
    Open source →

Every package, every release, already written down.

The archive is open and free. Watching your own project is what we are building next.

Browse the archive