UseMoor typedef

  1. @moorDeprecated
UseMoor = DriftDatabase

Use this class as an annotation to inform moor_generator that a database class should be generated using the specified DriftDatabase.tables.

To write a database class, first annotate an empty class with DriftDatabase and run the build runner using dart pub run build_runner build. Moor will have generated a class that has the same name as your database class, but with _$ as a prefix. You can now extend that class and provide a QueryExecutor to use moor:

class MyDatabase extends _$MyDatabase { // _$MyDatabase was generated
  MyDatabase():
    super(FlutterQueryExecutor.inDatabaseFolder(path: 'path.db'));
}

Implementation

@pragma('moor2drift', 'DriftDatabase')
@moorDeprecated
typedef UseMoor = DriftDatabase;