Setup
All you need to know about adding drift to your project.
Drift is a reactive persistence library for Dart and Flutter applications. It's built on top of database libraries like the sqlite3 package, sqflite or sql.js and provides additional features, like:
List<Map<String, dynamic>>
that they return, drift turns rows into objects of your choice.select(users).watch()
. That's it! No sql to write, no rows to parse..createAllTables()
. You don't need to manually write your CREATE TABLE
statements and keep them updated.And much more! Drift validates data before inserting it, so you can get helpful error messages instead of just an sql error code. Of course, it supports transactions. And DAOs. And efficient batched insert statements. The list goes on.
To get started with drift, follow the setup guide. It explains everything from setting up the dependencies to writing database classes and generating code.
It also links a few pages intended for developers getting started with drift, so that you can explore the areas you're most interested in first.
All you need to know about adding drift to your project.
Drift's Dart library for declaring tables and writing queries.
Define your database and queries in SQL without giving up on type-safety.
Tooling and APIs to safely change the schema of your database.
Store more complex data in columns with type converters
Use your own classes as data classes for drift tables
Options for drift_dev
and build_runner
to change the generated code.
All platforms supported by drift, and how to use them
Guide on writing unit tests for drift databases
Accessing drift databases on multiple isolates.
A set of CLI tools to interact with drift projects
Example apps using drift
Packages contributed by the community
Work in progress documentation on drift internals
How to upgrade between major drift versions