Dart API

Drift's Dart library for declaring tables and writing queries.

After writing a database as described in the setup page, drift will generate code enabling you to write SQL statements in Dart.

The pages on select statements and insert, updates and deletes explain how to construct statements.

Advanced features include support for transactions, complex SQL expressions and database accessor classes.

Dart tables

Everything there is to know about defining SQL tables in Dart.


Use easier bindings for common queries.


Select rows or individual columns from tables in Dart

Writes (update, insert, delete)

Select rows or invidiual columns from tables in Dart


Run multiple statements atomically


Deep-dive into what kind of SQL expressions can be written in Dart


Keep your database code modular with DAOs

Runtime schema inspection

Use generated table classes to reflectively inspect the schema of your database.


How to define SQL views as Dart classes