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.

Selects

Select rows or individual columns from tables in Dart

Writes (update, insert, delete)

Select rows or invidiual columns from tables in Dart

Transactions

Run multiple statements atomically

Expressions

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

DAOs

Keep your database code modular with DAOs

Runtime schema inspection

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

Views

How to define SQL views as Dart classes