Open-Awesome
CategoriesAlternativesStacksSelf-HostedExplore
Open-Awesome

© 2026 Open-Awesome. Curated for the developer elite.

TermsPrivacyAboutGitHubRSS
  1. Home
  2. Flutter
  3. Drift

Drift

MITDartdrift-2.32.1

A reactive, type-safe persistence library for Dart and Flutter built on SQLite.

Visit WebsiteGitHubGitHub
3.2k stars451 forks0 contributors

What is Drift?

Drift is a persistence library for Dart and Flutter applications that provides a reactive, type-safe interface to SQLite databases. It solves the problem of managing local data storage by offering compile-time safety, automatic query updates, and support for both SQL and Dart query languages. The library enables complex database operations while maintaining high performance across all major platforms.

Target Audience

Flutter and Dart developers building cross-platform applications that require robust local data persistence, particularly those who value type safety, reactive programming patterns, and SQL capabilities.

Value Proposition

Developers choose Drift because it uniquely combines the full power of SQL with Dart's type system, provides automatic reactive streams for queries, and offers built-in threading support for performance—all while maintaining excellent cross-platform compatibility.

Overview

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

Use Cases

Best For

  • Building Flutter apps with complex local data relationships that need automatic UI updates
  • Teams requiring compile-time validation of database queries to prevent runtime errors
  • Cross-platform applications that need consistent database behavior on mobile, desktop, and web
  • Projects that want to write database queries in both SQL and Dart depending on use case
  • Applications requiring high-performance database operations with isolate threading
  • Maintaining large codebases with modular database architecture using DAOs and imports

Not Ideal For

  • Projects with simple key-value storage needs where SharedPreferences or Hive would be sufficient
  • Teams unwilling to integrate code generation into their build process
  • Applications requiring built-in cloud synchronization or server-side database backends
  • Legacy projects deeply invested in other Flutter database libraries like sqflite without type safety

Pros & Cons

Pros

Type-Safe Queries

Compile-time verification catches errors early, with helpful lints to prevent runtime database issues, as emphasized in the 'Safe' section of the README.

Reactive Data Streams

Any SQL query, including complex joins, can be turned into an auto-updating stream, enabling real-time UI updates without manual state management.

Dual Query Language Support

Provides fluent APIs for both SQL and Dart, with support for advanced SQL features like WITH and WINDOW clauses, offering flexibility in query writing.

Cross-Platform Compatibility

Works seamlessly on Android, iOS, macOS, Windows, Linux, and the web from a single codebase, as highlighted in the key features.

Built-in Threading Support

Runs database operations across isolates with zero additional effort, improving performance on heavy loads, a unique feature among Flutter persistence libraries.

Cons

Code Generation Overhead

Requires running the drift_dev generator as part of the build process, which can slow down development cycles and add setup complexity.

Steep Learning Curve

Leveraging advanced features like complex SQL queries and reactive streams requires significant SQL and Dart knowledge, which might be a barrier for beginners.

Dependency on SQLite

Tied to SQLite, so not suitable for projects needing other database systems or server-side persistence without additional layers.

Frequently Asked Questions

Quick Stats

Stars3,191
Forks451
Contributors0
Open Issues211
Last commit1 day ago
CreatedSince 2019

Tags

#dart#database-orm#type-safe#sqlite#cross-platform#flutter#reactive#code-generation#persistence

Built With

S
SQLite
M
Melos
F
Flutter
D
Dart

Links & Resources

Website

Included in

Flutter59.5k
Auto-fetched 1 day ago

Related Projects

SqfliteSqflite

SQLite flutter plugin

Stars3,010
Forks552
Last commit2 days ago
Community-curated · Updated weekly · 100% open source

Found a gem we're missing?

Open-Awesome is built by the community, for the community. Submit a project, suggest an awesome list, or help improve the catalog on GitHub.

Submit a projectStar on GitHub