The rewritten compiler is faster than ever, supports more SQL features and gives you more flexibility when writing database code.
Pure SQL API
.moor files have been updated and can now hold both
CREATE TABLE statements
and queries you define. Moor will then generate typesafe Dart APIs based on your tables
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.
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 flexibilty, 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.
Moor lets you write query code faster with helpful actions.
Moor analyzes statements as you write them and reports errors right away. This helps you identify problems fast, without having to open your app.
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.
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