---
page:
  title: "Drift - Reactive, typesafe persistence library for Dart"
template: layouts/home.html
path: ""
data:
  show_favorites: true
---

{% block "blocks/cover.html" title="Drift: Persistence library for Dart" image_anchor="top" height="med" %}
<div class="mx-auto">
	<p class="h4">
		Drift is <em>the</em> relational persistence library for your Dart and Flutter apps.
		Write type-safe queries in Dart or SQL, enjoy auto-updating streams, easily managed transactions
		and so much more to make persistence fun.
	</p>
	<a class="btn btn-lg btn-secondary mr-3 mb-4" href="{{ 'docs/setup.md' | pageUrl }}">
		Get started <i class="fas fa-code ml-2 "></i>
	</a>
</div>
{% endblock %}

{% block "blocks/section.html" color="primary" %}

{% block "blocks/feature.html" icon="fas fa-lightbulb" title="Declarative tables, fluent queries" %}
{% block "blocks/markdown.html" %}
With drift, you can declare your database tables and queries in pure Dart without having to miss out on
advanced SQL features. Drift will take care of creating the tables and generate code
that allows you run fluent queries on your data.

[Get started now]({{ "docs/setup.md" | pageUrl }})
{% endblock %}
{% endblock %}

{% block "blocks/feature.html" icon="fas fa-database" title="Definitely relational" %}
{% block "blocks/markdown.html" %}
Drift is not the kind of ORM that tries to hide SQL away and then breaks down at the first
aggregation or non-obvious join.

Instead, drift embraces relational databases with an Dart API that's easy to learn
while still being close to SQL. Advanced expressions or subqueries are supported out of
the box.
{% endblock %}
{% endblock %}

{% block "blocks/feature.html" icon="fas fa-lightbulb" title="Safe schemas" %}
{% block "blocks/markdown.html" %}
A well-chosen SQL schema enables type-safe queries and avoids hard-to-spot mistakes.
Thanks to drift's extensive support for schema migrations, changing schemas is a safe
and easy process.
Further, drift provides a complete test toolkit to help you test migrations
between all your revisions.

[All about schema migrations]({{ "docs/Migrations/index.md" | pageUrl }})
{% endblock %}
{% endblock %}

{% block "blocks/feature.html" icon="fas fa-database" title="Prefer SQL? Drift's got you covered!" %}
{% block "blocks/markdown.html" %}
Drift ships a powerful sql parser and analyzer, allowing it to create typesafe methods for all your sql queries. All sql queries are
validated and analyzed during build-time, so drift can provide hints about potential errors quickly and generate efficient mapping
code.
Of course, you can mix SQL and Dart to your liking.

[Using SQL with Drift]({{ 'docs/SQL API/index.md' | pageUrl }})
{% endblock %}
{% endblock %}

{% block "blocks/feature.html" icon="fas fa-lightbulb" title="Supported on your favorite platform" %}
{% block "blocks/markdown.html" %}
Drift's core APIs are written to support a range of database libraries as backends, it doesn't even require Flutter.
Drift has primary first-class support for Android, iOS, macOS, Linux Windows and the web.

Other database libraries can easily be integrated into drift as well.

[All platforms]({{ "docs/Platforms/index.md" | pageUrl }})
{% endblock %}
{% endblock %}

{% block "blocks/feature.html" icon="fas fa-star" title="And much more!" %}
{% block "blocks/markdown.html" %}
Drift provides auto-updating streams for all your queries, makes dealing with transactions and migrations easy
and lets your write modular database code with DAOs.
When using drift, working with databases in Dart is fun!
{% endblock %}
{% endblock %}

{% endblock %}
