A reactive, type-safe persistence library for Dart and Flutter built on SQLite.
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.
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.
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.
Drift is an easy to use, reactive, typesafe persistence library for Dart & Flutter.
Compile-time verification catches errors early, with helpful lints to prevent runtime database issues, as emphasized in the 'Safe' section of the README.
Any SQL query, including complex joins, can be turned into an auto-updating stream, enabling real-time UI updates without manual state management.
Provides fluent APIs for both SQL and Dart, with support for advanced SQL features like WITH and WINDOW clauses, offering flexibility in query writing.
Works seamlessly on Android, iOS, macOS, Windows, Linux, and the web from a single codebase, as highlighted in the key features.
Runs database operations across isolates with zero additional effort, improving performance on heavy loads, a unique feature among Flutter persistence libraries.
Requires running the drift_dev generator as part of the build process, which can slow down development cycles and add setup complexity.
Leveraging advanced features like complex SQL queries and reactive streams requires significant SQL and Dart knowledge, which might be a barrier for beginners.
Tied to SQLite, so not suitable for projects needing other database systems or server-side persistence without additional layers.
Open-Awesome is built by the community, for the community. Submit a project, suggest an awesome list, or help improve the catalog on GitHub.