Drift

Web · Windows · Mac · Linux · Android · iPhone · Extension

Freedom report

Two barsScore 5.8

  • Free tierNo free tier on record
  • Open codeNo open-source code on record
  • Runs widely6 of 6 device platforms
  • DocumentedPlans, terms and facts published

Drift is a reactive persistence library for relational data in Dart and Flutter applications. It maps database rows to selected objects and offers type-safe queries; watched queries can update as streams when underlying data changes. Its SQL parser and analyzer can validate queries at compile time and generate Dart row code, using drift_dev and build_runner for code generation. Drift supports SQLite and provides packages for PostgreSQL and libSQL connections, including local-copy synchronization with libSQL. Migration utilities are available, but developers must write migrations when changing schemas already used by apps. Encrypted databases are possible with SQLite3MultipleCiphers and a NativeDatabase executor, provided the app sets an encryption key. Documented implementations cover Android, iOS, Windows, Linux, macOS, and web. Some APIs, including date-time modification APIs, are SQLite-only with PostgreSQL. Full web support may require COOP/COEP security headers, and Chrome on Android can have cross-tab persistence issues without those headers. Documentation includes a DevTools extension page; questions and feedback can go to GitHub discussions.

Who it is for

Drift is for developers building Dart or Flutter applications that need relational persistence. It may suit teams that want type-safe queries, reactive updates, and documented connections to SQLite, PostgreSQL, or libSQL.

What is good

  • Type-safe queries and reactive watched-query streams
  • Compile-time SQL validation and Dart row generation
  • Documented support for six platform families
  • SQLite, PostgreSQL, and libSQL connections

What to know first

  • Developers must write schema-change migrations
  • Some APIs are SQLite-only with PostgreSQL
  • Some browsers need COOP/COEP headers for full web support

Freedom251 review

Drift: the full review

Drift combines relational persistence with generated code and reactive queries for Dart and Flutter projects. Developers should account for required schema migrations and the documented PostgreSQL and browser limitations.

Overview

Drift is a relational persistence library for developers building applications with Dart or Flutter. It suits projects that want SQL-backed data with typed access and reactive query results, but schema changes require deliberate migration work.

Its central appeal is the combination of relational storage and queries that can update as underlying data changes. The trade-off is a developer-focused setup: code generation is part of the workflow, and existing databases need migrations written when their schema changes.

Key features

Typed, reactive data access

Drift maps database rows to objects chosen by the developer and provides type-safe queries. Queries can be watched as streams that update when stored data changes. That makes it a good fit when application logic needs to respond to database updates, rather than handling results only as one-off reads.

SQL validation and generated code

An SQL parser and analyzer can validate queries at compile time, and Drift can generate Dart row code. The setup relies on drift_dev and build_runner. That tooling can help catch query problems earlier, but it also makes Drift less attractive to developers seeking a persistence layer without a code-generation workflow.

Database options and migrations

Drift supports SQLite and offers packages for PostgreSQL and libSQL connections; its documentation also covers remote libSQL and Turso. Most queries work with PostgreSQL without modification, but some APIs—including date-time modification APIs—are SQLite-only. Check those differences before choosing PostgreSQL for an app that depends on affected APIs.

Migration utilities are provided, but developers must write migrations when changing a schema used by an existing app. That gives teams a route to manage schema evolution, not an automatic way to handle it.

Encryption and developer support

Encrypted databases are possible through SQLite3MultipleCiphers with a NativeDatabase executor, provided the app sets an encryption key. Drift's documentation includes a DevTools extension page, and the setup guide directs questions and feedback to GitHub discussions.

Pricing

Drift is free, with a free plan. No paid tiers or seat-based terms are part of its stated offering. Its cost advantage is straightforward for projects that need a Dart and Flutter persistence library, though the free plan does not remove the engineering work of code generation or schema migrations.

Platforms

Documented implementations support Android, iOS, Windows, Linux, macOS, and web. Web projects need to account for browser security requirements: some browsers need COOP/COEP headers for full support, and Chrome on Android can have cross-tab persistence issues without the required headers. These constraints matter for browser deployments and should be checked against the hosting setup.

Drift supports offline use and bidirectional synchronization. Its SDK languages are Dart and Flutter, so it is aimed at those application stacks rather than a general-purpose database client for unrelated languages.

Who it's for

Choose Drift for a Dart or Flutter app that needs relational persistence, type-safe queries, and query streams that respond to data changes. It is particularly suited to developers comfortable managing generated code and writing migrations as schemas evolve.

Drift's strengths are most relevant when its SQL-oriented model and Dart integration match the application architecture.

Pros and cons

  • Pros: Type-safe queries and mapped rows give Dart code structured access to relational data.
  • Pros: Watched queries update as database contents change, useful for reactive application logic.
  • Pros: Compile-time SQL analysis and generated Dart row code support SQL-heavy workflows.
  • Pros: SQLite, PostgreSQL, and libSQL options, along with offline use and bidirectional synchronization, cover varied persistence needs.
  • Cons: Existing database schema changes require developers to write migrations.
  • Cons: Some APIs are SQLite-only, limiting portability for PostgreSQL projects that use them.
  • Cons: Full web support can depend on COOP/COEP headers, with cross-tab persistence caveats in Chrome on Android.
  • Cons: Code generation requires drift_dev and build_runner as part of setup.

Alternatives

Browse mobile databases to compare other persistence options. Choose Espresso instead when Android UI testing is the need: its free plan targets a single Android app and supports Android 4.0.1/API 14 and later, rather than providing Drift's relational persistence role.

Hive is another free option with a free plan and trial; its stated plan centers on AI credits, storage, workspace members, and tasks, rather than Drift's typed SQL workflow. Consider RxDB when its free core, replication and realtime sync, and default storages better match the project; Drift is the more direct fit for Dart and Flutter relational persistence.

Ditto is an alternative mobile database. ObjectBox is another alternative, with a free database plan and a separate Sync offering. For projects focused on cloud messaging rather than persistence, Firebase Cloud Messaging is the relevant alternative. Firestore is worth considering when its document-read and document-write model better suits the application than Drift's relational approach. TBase is another database option to compare.

Verdict

Drift is a strong choice for Dart and Flutter developers who want relational data access with type safety, compile-time SQL checks, and reactive query streams at no cost. Choose it when those capabilities outweigh the need to write schema migrations and accommodate backend or browser-specific limitations; look elsewhere if those constraints conflict with the project.

Compared on mobile databases

Free plan
Yes
Offline mode
Yes
Data synchronization
bidirectional
Mobile platforms
Android, iOS
SDK languages
Dart, Flutter

Best Drift alternatives

See all 20