Documentation & Guides

Welcome to moor's documentation. This site shows you what moor can do and how to use it.

Welcome to moor

Moor is a reactive persistence library for Dart and Flutter applications. It's built on top of database libraries like sqflite or sql.js and provides additional features, like:

  • Type safety: Instead of writing sql queries manually and parsing the List> that they return, moor turns rows into objects of your choice.
  • Stream queries: Moor let's you "watch" your queries with zero additional effort. Any query can be turned into an auto-updating stream that emits new items when the underlying data changes.
  • Fluent queries: Moor generates a Dart api that you can use to write queries and automatically get their results. Keep an updated list of all users with select(users).watch(). That's it! No sql to write, no rows to parse.
  • Typesafe sql: If you prefer to write sql, that's fine! Moor has an sql parser and analyzer built in. It can parse your queries at compile time, figure out what columns they're going to return and generate Dart code to represent your rows.
  • Migration utils: Moor makes writing migrations easier thanks to utility functions like .createAllTables(). You don't need to manually write your CREATE TABLE statements and keep them updated.

And much more! Moor validates data before inserting it, so you can get helpful error messages instead of just an sql error code. Of course, it supports transactions. And DAOs. And efficient batched insert statements. The list goes on.

Check out these in-depth articles to learn about moor and how to use its features.

Getting started

Simple guide to get a moor project up and running


Example apps using moor

Advanced Features

Learn about some advanced features of moor

Using SQL

Write typesafe sql with moor


Run multiple queries atomically

Other engines

Use moor on the web or other platforms

Moor internals

Work in progress documentation on moor internals


Packages contributed by the community


Guide on writing unit tests for moor databases

Supported platforms

All platforms supported by moor, and how to use them

Command line tools for moor

A set of CLI tools to interact with moor files

Frequently asked questions