Simple guide to get a drift project up and running
Documentation & Guides
Welcome to drift
- Type safety: Instead of writing sql queries manually and parsing the
List<Map<String, dynamic>>that they return, drift turns rows into objects of your choice.
- Stream queries: Drift lets you "watch" your queries with zero additional effort. Any query can be turned into an auto-updating stream that emits new items when the underlying data changes.
- Fluent queries: Drift generates a Dart api that you can use to write queries and automatically get their results. Keep an updated list of all users with
select(users).watch(). That's it! No sql to write, no rows to parse.
- Typesafe sql: If you prefer to write sql, that's fine! Drift has an sql parser and analyzer built in. It can parse your queries at compile time, figure out what columns they're going to return and generate Dart code to represent your rows.
- Migration utils: Drift makes writing migrations easier thanks to utility functions like
.createAllTables(). You don't need to manually write your
CREATE TABLEstatements 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.
Check out these in-depth articles to learn about drift and how to use its features.
Example apps using drift
Learn about some advanced features of drift
Write typesafe sql with drift
Run multiple statements atomically
Use drift on the web or other platforms
Work in progress documentation on drift internals
Packages contributed by the community
All platforms supported by drift, and how to use them
How to upgrade between major drift versions
A set of CLI tools to interact with drift projects
Guide on writing unit tests for drift databases