By Abdelrahman Saed — Senior Mobile Engineer. Last updated: 2026-08-10.
Drift is a reactive, type-safe SQLite ORM for Flutter and Dart. It uses code generation to create typed table definitions and query APIs, with built-in support for reactive streams that automatically rebuild the UI when database rows change.
Drift generates Dart classes from your schema definitions:
// Define tables
class Stories extends Table {
TextColumn get id => text()();
TextColumn get title => text()();
IntColumn get position => integer()();
BoolColumn get isCompleted => boolean().withDefault(const Constant(false));
@override
Set<Column> get primaryKey => {id};
}
// Define the database
@DriftDatabase(tables: [Stories])
class AppDatabase extends _$AppDatabase {
AppDatabase() : super(_openConnection());
// Reactive query — returns a Stream that rebuilds when data changes
Stream<List<Story>> watchStories() {
return (select(stories)..orderBy([(t) => OrderingTerm(expression: t.position)])).watch();
}
}
The watch() method is the killer feature: it returns a Stream<List<Story>> that emits a new list whenever any story row changes. The UI rebuilds automatically — no manual invalidation, no event bus, no setState.
At iStoria, Drift is the local data layer that PowerSync syncs against. Every read of user progress, chapters, streaks, and levels comes from Drift. When PowerSync updates a row in the background, Drift's stream emits a new value and the UI rebuilds.
Use Drift when:
Choose Hive or Isar instead when:
Drift builds on sqflite and adds type safety, reactive streams, code generation, and migration helpers. For any app with more than one table, Drift is the better choice — raw sqflite requires hand-written SQL strings and manual cache invalidation. See our Drift vs sqflite comparison.
Yes — PowerSync exposes its synced tables as Drift-compatible views. You define your Drift schema to match the PowerSync sync rules, and PowerSync populates the tables. Drift's reactive streams then auto-update the UI as PowerSync syncs changes.
Available for hire. Abdelrahman Saed is a Senior Mobile Engineer (Flutter) — open to full-time, fractional, contract, or advisory work. Hire me →
Book a 20-minute call · Download the CV (PDF) · See how I work