Generator overhaul
The rewritten compiler is faster than ever, supports more SQL features and gives you more flexibility when writing database code.
Pure SQL API
The new .moor
files have been updated and can now hold both CREATE TABLE
statements and queries you define. Moor will then generate type-safe Dart APIs based on your tables and statements.
Analyzer improvements
We now support more advanced features like compound select statements and window functions, including detailed static analysis and lints. The updated type inference engine provides better results on complex expressions. We also generate simpler methods for queries that only return one column.
Dart-SQL interop
Declare tables in Dart, write your queries in SQL. Or do it the other way around. Or do it all in Dart. Or all in SQL. Moor makes writing database code fun without taking control over your code. For maximum flexibility, moor lets you inline Dart expressions into SQL and use the best of both worlds.
Builtin SQL IDE
Moor 2.0 expands the previous SQL parser and analyzer, providing real-time feedback on your SQL queries as you type. Moor plugs right into the Dart analysis server, so you don't have to install any additional extensions.
Quickfixes
Moor lets you write query code faster with helpful actions.
Smart warnings
Moor analyzes statements as you write them and reports errors right away. This helps you identify problems fast, without having to open your app.
Structure view
Moor provides an outline of your tables and queries for a better overview.
And much, much more
Moor 2.0 contains a set of optimizations and makes common tasks simpler
New database helpers
New utils to load database from assets or to perform additional work before creating a database.
Removed deprecated features
We removed a whole bunch of deprecated apis that made it harder to develop new features.
Experimental dart:ffi
bindings
The new moor_ffi package brings moor to the desktop and is up to 500x faster than the old implementation.
Please not that the package is still in preview
Try moor now
- To get started with moor, follow our getting started guide here.
- To get started with SQL in moor, or to migrate an existing project to moor, follow our migration guide