Library / SDK
simolus3/drift avatar
simolus3/drift

Drift is a Dart persistence library whose real claim is running queries across isolates

Drift is an easy to use, reactive, typesafe persistence library for Dart & Flutter.

3,301 stars476 forksDartMIT

At a glance

What is it?
A reactive SQLite library for Flutter and Dart that generates type-safe code from your tables, lets you write queries in SQL or in Dart, and turns any query into an auto-updating stream. Its release line is active, its default branch is a development branch, its CI builds a 2022 SQLite from source on an unpinned base image, and the examples already contain an application for a version that has not shipped.
Who is it for?
Drift suits a Flutter project that has outgrown storing a map in memory and wants queries with joins and migrations plus reactive updates, and that values compile-time errors on a malformed query over finding them at runtime. It does not suit someone who wants raw SQL with no code generation step, since the type safety is a consequence of generating code.
Can I use it commercially?
Yes. MIT is a permissive licence: you can use, modify and sell software built on it, as long as you keep its copyright and licence notices.
Is it still maintained?
Yes. The repository received new commits within the last day.
What is it written in?
Mainly Dart, according to GitHub's language statistics.

Answers come from the project's GitHub data, last synced on November 15, 2026, and from our analysis. They are not legal advice.

From daily snapshots

Star history

  • simolus3/drift3,301 ★ · +20
Star history
Repository2026-09-242026-11-15
simolus3/drift3.3k3.3k

20 Stars in the last 52 days, measured from the daily GitHub snapshot. Compare with other projects

Editorial analysis

The claim to set against the others is running queries across isolates

A feature list of nine items is a list of things everyone claims, so the one worth isolating is the one nobody else says.

Eight of the items are table stakes for a database library: transactions, schema migrations, joins, filters, batched updates, cross-platform support, a lot of tests, and type safety. Two are more specific. One is that any SQL query can be turned into an auto-updating stream. The other is the performance claim, that it can keep up with key-value stores.

The performance claim comes with a specific mechanism attached, and that mechanism is the differentiator: the library says it is the only major persistence library for this ecosystem with builtin threading support, which allows database code to run across isolates with no additional effort.

That is the sentence to test the alternatives against. Everything else on the list is parity. Whether a long query blocks the UI thread is not parity, and in a framework where isolates are the unit of concurrency it is the whole argument.

The two web worker examples in the repository's example directory are consistent with that emphasis, since a worker example is the isolated case of it.

Type safety is generated code, and mistakes surface as lints

The safety claim is worth reading precisely, because it explains why the project has a compiler at all.

It says the library generates type-safe code based on your tables and queries, and that if you make a mistake in a query it will be found at compile time, with helpful and descriptive lints.

So the guarantee is not runtime validation. It is that a wrong query does not compile. That is a stronger guarantee than most libraries offer, and it comes at the price that there is a code generation step, which is why a separate companion package exists.

The mechanism also explains the second feature claim, the built-in SQL editor for the Dart analyzer. If your queries are compiled into Dart, the analyzer has something to check, and a query written by hand in a SQL string has somewhere to point out that the column does not exist.

That is a coherent design, and it is why the project is three packages rather than one: a runtime, a generator, and a parser that can be used on its own.

The trade-off is that your database access is now generated Dart rather than a string you pass at runtime, which is a real difference in how you debug and how you review changes.

A third package on the registry that has nothing to do with the library

The section on working on the project names three packages, and the third one is not part of the library.

The first is the runtime, described as providing most of the API. The second is the companion generator, described as the compiler for tables, databases and data access objects, and it is also where the SQL editor for the analyzer lives.

The third is a SQL parser and static analyzer written in pure Dart, and the readme says explicitly that this package can be used without the rest of the project to analyse SQL statements. It is published separately.

That is a well-judged extraction. SQL analysis is useful on its own, for a linter, a migration tool, or a codebase that has SQL strings and nothing else, and folding it into the main package would force every consumer to take the analyzer with them.

It also tells you what the maintainer thinks is separable. If you only want to check SQL in a project that is not using this library at all, that package is the install.

The repository tree is broader still, with separate directories for the Flutter integration and for a driver package, a directory whose name refers to unfinished work, and an examples directory holding ten applications.

The CI image builds a 2022 SQLite from source on an unpinned base

The container file is short and has two decisions in it that are worth arguing about.

The base image is the Dart image with no tag at all. Not a version, not a digest. Whatever that tag points to today is what the build runs against, and a change to that image silently changes the toolchain under every test run.

Then the image downloads a specific SQLite source tarball from the project's own site, a 2022 autoconf release, configures it, makes it, and copies both the command line binary and the shared library into a directory that is later put on the library path.

So the test suite runs against a pinned, self-compiled SQLite from four years ago, on an unpinned language image. Those are opposite choices in the same file.

Building SQLite from source is defensible, because it avoids depending on whatever the base image ships. Pinning to a 2022 release is less so, because the library's whole selling point includes SQLite features, and the newest ones are the ones a four-year-old amalgamation will not have.

The rest of the file is careful: it installs a browser and a compiler, symlinks the browser to the name a test expects, creates an unprivileged user, runs the upgrade script, and sets the library path in the run command.

The example set already contains an application for version three

There is an examples directory with ten applications in it, and one of the names is a version number rather than a feature.

Alongside it is a plain application directory. There is an application specifically for the encryption case, one for migrations, one described as modular, one for using the library across multiple packages, and one built on a different state-management approach rather than the library's own.

Then two worker examples, one of them explicitly for the framework's worker mechanism and one for the plain web worker case.

And one named for a version three of the library. The release line is at two and a third of a hundred, so that directory is work towards a major version that has not shipped, sitting in the examples of the two-point line.

That is a normal thing to do and a useful thing to see. It also means the example tree is the place where the project's plans are visible, because the changelog for an unreleased major version does not exist yet.

For anyone evaluating the library, the set of examples is a better description of the intended scope than the feature list, and it is the only place the version three work is visible at all.

Two sponsors, and one link carries five tracking parameters

The sponsors section is two companies and a small amount of evidence about how a Dart persistence project is funded.

One is a chat product for the same framework, and the other is a synchronisation service. Each has a cell in a two-column table with an image and a line of text inviting you to try a tutorial, and the second cell's text points at a guide about using that service with a hosted relational database.

What is interesting is the links themselves. The first sponsor link carries five separate tracking parameters: a source, a medium, three content and campaign slots including a month and a year, and a long opaque suffix. The second carries two.

So one of the two is being promoted with per-campaign attribution that pins the campaign to a specific month in a past year, and the other is not. That is what sponsorship markdown looks like when it is written once and left.

It is harmless, and it is also a reasonable proxy for how the project is funded: two commercial companies with a direct interest in the framework, neither of them a foundation, and no individual donors listed.

A directory named for the future sits at the repository root

The last structural detail is a directory name, and it is worth knowing about before you read anything else in the tree.

There is a directory at the repository root whose name is the word for something that has not happened yet. It sits beside the package directories, the examples and the tooling.

Projects that keep such a directory are usually accumulating designs, or spikes, or code that is written but not wired in. None of that is visible from the name, and it is not mentioned in the readme.

The rest of the root is conventional: four package directories, a melos workspace file, a publishing specification, a hosting configuration for the documentation site, a container file, a scripts directory for the test entry points the container calls, a documentation directory and a contributions guide.

The default branch is a development branch rather than a main one, and the release tags are named after the package and version. Both of those are ordinary for a project at this stage, and both mean the thing you clone is not the thing you install.

The branch was last pushed at the end of September 2026, and the three most recent releases all fall in September 2026.

Editorial conclusion

Drift suits a Flutter project that has outgrown storing a map in memory and wants queries with joins and migrations plus reactive updates, and that values compile-time errors on a malformed query over finding them at runtime. It does not suit someone who wants raw SQL with no code generation step, since the type safety is a consequence of generating code. Before you adopt it, check three things: which of the two published packages you need, because the generator is a separate install; whether you need queries across isolates, since that is the differentiator it claims over other persistence libraries; and whether you are comfortable with a build step that fails at compile time rather than a library that runs as written, because that is where its safety comes from.

Frequently asked questions

What is Drift the Dart library?

A reactive persistence library for Flutter and Dart built on SQLite, MIT licensed. It generates type-safe Dart from your table definitions so a wrong query fails at compile time with lints rather than at runtime, it lets you write queries in either SQL or Dart, and any query can be turned into a stream that updates itself. The readme's specific claim over other persistence libraries is builtin threading support, running database code across isolates with no additional effort.

Does Drift work on the web and on desktop?

The readme states support for Android, iOS, macOS, Windows, Linux and the web, and links a Flutter todo application template that works on all of them. The example directory backs that up with two worker examples, one for the framework's worker mechanism and one for the plain web worker case, plus a separate example for encrypted databases and another for schema migrations.

how to install drift

Two packages are published on the package registry: the runtime, and a companion generator described as the compiler for tables, databases and data access objects, which also contains a SQL editor for the Dart analyzer. A third package is a pure Dart SQL parser and static analyzer that can be used without the library at all. To work on the repository itself you install a workspace tool globally and then bootstrap it in the project directory.

Is Drift still being updated?

The three most recent releases all fall in September 2026, two of them less than a month apart, on a stable two-part version line. The repository's default branch is a development branch rather than a main one, and the branch itself was last pushed at the end of September 2026. There is also an example application named for a version of the library that has not shipped yet.

Official sources

  1. License: MIT
  2. Project website
  3. README
  4. Releases
  5. simolus3/drift on GitHub
Add this badge to your README

If you maintain this project, the badge below links readers to this analysis and shows its maintenance status from the daily GitHub snapshot. Paste the markdown into your README; add ?metric=license or ?metric=stars to the image URL for a different field.

Add this badge to your README

markdown
[![Hysen Labs](https://hysenlabs.com/badge/simolus3-drift.svg)](https://hysenlabs.com/projects/simolus3-drift)

Star history chart for your README

markdown
[![Star history](https://hysenlabs.com/chart/simolus3-drift.svg)](https://hysenlabs.com/projects/simolus3-drift)

Was this useful?