A Flutter app that ships with raw sqflite calls looks fine for six months. Then you add a column, a user updates the app over an existing database, and every screen that reads that table starts throwing no such column: priority — on exactly the installs you cannot reproduce, because your test device always starts from a clean database.
That failure mode is what an ORM is supposed to prevent. In the Dart ecosystem there are three mature-ish answers, and they disagree sharply about how much code should be generated, how migrations should work, and whether your queries should run on the UI isolate.
Quick verdict: use drift for anything you intend to maintain — it has the only credible story for type-safe SQL, reactive queries, isolate threading, and incremental migrations. Use floor if you are porting a Room-style Android codebase and want familiar entities and DAOs, accepting a library whose last release was in 2024. Use sqfEntity only for small internal apps where generated CRUD forms and rapid scaffolding matter more than long-term maintenance.
The Three Contenders Side by Side
| Criterion | drift | floor | sqfEntity |
|---|---|---|---|
| Latest version | 2.35.4 (Nov 2026) | 1.5.0 (May 2024) | 2.5.0 (Jul 2024) |
| GitHub stars | 3,306 | 1,025 | 381 |
| Last commit | Dec 2026 | Aug 2024 | Jun 2026 |
| License | MIT | Apache-2.0 | Not detected on the GitHub repo |
| Query style | Dart fluent API and raw SQL files | SQL strings in annotations | Fluent filter chain |
| Reactive streams | Built in, any query | Built in for Stream return types | Limited |
| Background isolate support | Yes, built in | No | No |
| Migration tooling | MigrationStrategy, schema verification, step-by-step | Migration objects per version | Auto schema sync, limited control |
| Web support | Yes | No | No |
| Generated code volume | Medium (*.g.dart) | Medium (*.g.dart) | High (model plus optional form views) |
| Learning curve | Steepest | Moderate | Lowest |
The version column tells most of the story before any benchmark does. drift shipped 2.35.x in November 2026; floor’s newest release is 1.5.0 from May 2024; sqfEntity’s runtime has not been released since July 2024 even though its repository saw commits in 2026.
Decision Matrix: Ten Seconds to a Choice
| Your situation | Pick | Why |
|---|---|---|
| New Flutter app with more than three tables | drift | Migrations, reactive streams, and isolate support are all first-class |
| App must run on web and desktop too | drift | floor and sqfEntity are mobile-focused; drift targets all six platforms |
| Porting an Android Room codebase to Flutter | floor | The entity/DAO/@Query model will feel familiar |
| Internal tool that needs CRUD forms fast | sqfEntity | Generates list and edit views from table definitions |
| Team refuses to learn a query builder | floor | Plain SQL in annotations, minimal abstraction |
| You need complex joins with compile-time checks | drift | SQL is analyzed at build time, not at runtime |
| Long-lived product with schema evolution | drift | Versioned migration steps plus schema verification tests |
drift — SQL That the Compiler Checks
drift is the only one of the three that treats SQL as a first-class language and still gives you a typed Dart API. You declare tables in Dart, or write .drift SQL files, and the generator produces both the schema and the query classes.
| |
| |
The watchOpenItems method is the feature that changes how you write UI code. Every read can be a stream that re-emits when the underlying table changes, which means your StreamBuilder stays correct without manual invalidation. With sqflite and hand-written SQL, that plumbing is yours to write and yours to get wrong.
Migrations are explicit and ordered:
| |
drift also runs database work on a background isolate by default when you use driftDatabase, which matters more than most benchmarks: a 40ms query on the UI isolate is a dropped frame, and a 400ms query during a large import is a visible freeze.
The cost is complexity. You will run dart run build_runner build constantly, deal with part files, and learn the difference between select, into, and update. If your team has never used a query builder, budget a week.
floor — Room’s Model, Flutter’s Runtime
floor deliberately copies Android’s Room: annotated entities, abstract DAOs, SQL in @Query strings, and a generated database class. If you have shipped Room, you can read floor code immediately.
| |
| |
| |
| |
Wiring the migration in is a separate step that people forget:
| |
That forgetting is not hypothetical — a missing addMigrations call produces a runtime DatabaseException on upgrade, on real user devices, after release. floor does not verify your migrations against your entities the way drift’s schema tests do.
The bigger issue in 2026 is maintenance. floor 1.5.0 was published in May 2024 and the repository’s last commit was August 2024. It still works with current Flutter versions because the underlying sqflite API is stable, but a two-year gap in a code-generation package is a real risk: when Dart changes analyzer APIs again, nobody is obligated to publish a fix.
sqfEntity — Scaffolding Over Architecture
sqfEntity inverts the usual tradeoff. Instead of writing entities and DAOs, you declare tables as constants, run the generator, and get models, CRUD methods, and optionally add/edit form views.
| |
After flutter pub run build_runner build --delete-conflicting-outputs, the generated model gives you a filter chain that reads almost like English:
| |
The useSoftDeleting: true flag is genuinely useful for apps with sync: deletes become isDeleted = 1, and recover() restores a row, which avoids the classic “deleted on device, resurrected by the server” conflict.
The problems show up later. Schema changes are handled by the generator’s version tracking rather than explicit migration steps, so a complex change (splitting a table, backfilling a column) has no clean hook. There is no isolate support, so a large query runs wherever you call it. Web is not supported. And the GitHub repository reports no detected license, which is the kind of detail that stalls a procurement review — verify licensing with the author before you build a product on it.
Migrations Are Where These Libraries Actually Differ
Every ORM demo looks the same. The differences appear in year two, when you have users on version 1, 3, and 7 of your schema.
drift lets you write a migration step per version and then test it. The generated schema can be exported and compared in a test, so a forgotten column fails CI rather than a user’s device. That is the single most valuable feature in this comparison, and it is the reason drift wins for long-lived apps.
floor gives you Migration(from, to, callback) objects and a list you must pass to the builder. It works, and the SQL is explicit, but nothing checks that the migration matches the entity definitions. A typo in a column name compiles and fails at runtime.
sqfEntity leans on generated code to keep the schema in sync, which is convenient until it is not: automatic synchronization cannot invent a backfill strategy, and a destructive change may drop data that you needed to transform first.
Performance and Threading Notes
All three ultimately call SQLite through sqflite on mobile. Raw insert throughput is close enough that you should not choose on microbenchmarks; the real differences are structural.
- Isolate offloading: only drift does this out of the box. On a mid-range Android device, a 5,000-row import that takes 300ms will produce visible jank on the UI isolate with floor or sqfEntity.
- Reactive queries: drift and floor both support streams; sqfEntity’s support is thinner. If your UI depends on live data, this is a design constraint, not a nice-to-have.
- Query compilation: drift analyzes SQL at build time, so a bad join fails before you ship. floor and sqfEntity surface those errors at runtime.
- Generated code size: sqfEntity generates the most code, especially with
formTablesenabled, which affects compile times in large projects.
Pitfalls to Avoid
- Committing generated files without a regeneration check. All three rely on
build_runner. Add a CI step that regenerates and fails ifgit diffis non-empty, or your generated code will drift from your schema. - Bumping
schemaVersionwithout a migration. drift will throw at runtime; floor will throw aDatabaseException; sqfEntity may silently recreate. Test the upgrade path from the previous released version, not from a fresh install. - Running queries on the UI isolate in a list view. Even a 30ms query inside
itemBuilderbecomes jank when multiplied by scroll events. Batch with a single stream instead. - Using
floorwithoutaddMigrations. The migration classes exist but are inert until registered on the builder. - Choosing sqfEntity for a multi-year product. Generated forms are a shortcut for prototypes, not an architecture.
- Assuming web support. floor and sqfEntity are mobile-first. If you also target web, drift is the only option here.
Why Bother With an ORM at All?
The honest answer is migrations and type safety, not elegance. A hand-written sqflite layer works until the first schema change, and then every query that touches the changed table becomes a potential runtime crash that only reproduces on upgraded installs. An ORM that analyzes SQL at build time and forces you to declare migration steps converts those crashes into compile errors and failing tests.
That tradeoff is the same one you make on the server side. If you are building the backend for your Flutter app in Dart, our Dart server-side frameworks comparison covers the other half of the stack, the Dart serialization guide shows how to keep model classes in sync with your API payloads, and the Dart dependency injection comparison explains how to wire a database instance through your widget tree without globals.

FAQ
Which Dart ORM is best for a new Flutter app in 2026?
drift. It is the only one of the three with active releases, compile-time SQL analysis, built-in isolate support, and a migration strategy you can test. floor is viable for Room-style codebases but has not shipped a release since May 2024, and sqfEntity’s runtime has not been released since July 2024.
Is floor still maintained?
The repository’s last commit was in August 2024 and the newest published version is 1.5.0 from May 2024. It continues to work because it depends on the stable sqflite API, but code generators are sensitive to Dart analyzer changes, so a two-year gap is a genuine maintenance risk for a long-lived product.
Can I use these libraries on Flutter web?
Only drift supports web, and it does so through SQLite compiled to WebAssembly with a persistent storage backend. floor and sqfEntity are mobile-focused and do not support web targets, which matters if you ship a single codebase to browsers and phones.
How do migrations work in drift?
You increment schemaVersion and implement MigrationStrategy.onUpgrade, where you apply ordered steps such as m.addColumn(...) or m.createTable(...). drift can also export schema snapshots so tests verify that migrations produce the same schema as a fresh install.
Why does floor need addMigrations separately from the Migration objects?
The Migration objects only describe what to run between two versions. They are inert until you pass them to databaseBuilder(...).addMigrations([...]). Forgetting that call is a common cause of upgrade crashes that only appear on devices with an existing database.
Is sqfEntity suitable for commercial applications?
Check the license first. The GitHub repository reports no detected license, which is a blocker for many procurement processes. Beyond licensing, its lack of isolate support, web support, and explicit migration hooks makes it a poor fit for long-lived products even when the license is acceptable.
💰 想测试你的市场判断力?我用 Polymarket 做预测市场交易——这是全球最大的预测市场平台,从大选结果到技术监管时间线,什么都可以押注。和赌博不同,这是真正的信息市场:你懂的信息越多,胜率越高。我靠预测技术相关事件的走向已经赚了不少。用我的邀请链接注册:Polymarket.com